I am new to programming and currently am learning C++. One of the topic that i couldn't really understand that much is OOP. I had a tutor helping me but he's not really helpful so now I'm stuck on how to solve this. The question is as per image attached and this code is what I've worked on so far. C++ Program Requirements. I hope someone can help me on how to continue from here.
#include <iostream>
#include <iomanip>
#inlcude "term.h"
using namespace std;
class Term{
private:
int k //represents current term number
int a //represents coefficient for the current term
int x //represents the value for x
public:
};
int main()
{
Term poly[10];
int n,x;
cout << "Please enter how many terms that you wish"
<< "to calculate a polynomial equation" << endl;
cin >> n;
cout << "Please enter the value for x for the polynomial equation" << endl;
cin >> x;
double sum = 0;
for (int k = 0; k < n; k++)
{
int coeff;
cout << "Please enter coefficient for term " << k << endl;
cin >> coeff;
poly[k].setCoeff(coeff); //setting the coefficient
poly[k].setX(x); //setting the x
poly[k].setK(k); //setting the k
cout << "The result for term "
<< coeff << " * " << x << "^" << k << " is ";
cout << poly[k].calcTerm() << endl;
sum += poly[k].calcTerm();
}
cout << "The summation for all terms is " << sum << endl;
return 0;
}