The input numbers I put in does not work with instead it shows " the pointed number?(I think that's what it is called) versus my actual input. and I also get program.exe stopped working popupp window
(1) Testing `cout << A': empty
(2) Testing `cin >> A':
Enter the polynomial (integer order then double coefficients):
2 2 0 2
(3) Second look at A: 278884242105282788842411052827888424010528
Press any key to continue . . .
// TestThePoly.cpp
#include <iostream>
using std::cout;
using std::endl;
using std::cin;
usingnamespace std;
#include "Polynomial.h"
int main()
{
Polynomial A;
cout << "(1) Testing `cout << A': " << A << endl;
cout << "(2) Testing `cin >> A':\n";
cout << "Enter the polynomial (integer order then double coefficients):\n\t ";
cin>>A;
cout << endl;
cout << "(3) Second look at A: " << A << endl;
Polynomial B(A);
cout << "(4) Testing `Polynomial B(A)': " << B << endl;
double clist[]={8, 4.5, 1};
Polynomial C(2, clist);
cout << "(5) Testing `Polynomial C(2, clist)': " << C << endl;
Polynomial D=C;
cout << "(6) Testing D = C): " << D << endl;
cout << "(7) Testing A == B : " << (A==B ? "TRUE" : "FALSE") << endl;
cout << "(8) Testing A == D : " << (A==D ? "TRUE" : "FALSE") << endl;
return 0;
}
HERe's directions
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
I have provided a basic testing program, TestThePoly.cpp, and a header le,
Polynomial.h, for a polynomial class called Polynomial. Your job is relatively easy:
complete the class declaration in the header and then implement the functions that are in
the header le and test them to to ensure they work as advertised.
The testing program supplied is very basic. You will be expected to modify it and add
some (two or three) more tests to ensure that all aspects of the newclass are exercised.
For those who may be confused, the \degree" of a polynomial is the highest degree of its
terms. For instance
4x3 + 3x2 + 0:3x 1:54
is a polynomial of degree 3. Note: In this example there is one more term than the degree
of the polynomial.
1. The declaration should match the interface shown in the provided incomplete header
file Polynomial.h. Please understand that the actual structure of the private mem-
bers and functions of this class are up to you to design. Also, the degree of the
polynomial can be any nonnegative integer value (from 0 up to the sky is the limit).
2. The behavior of the class and its methods should duplicate that shown by the example
test application TestThePoly.cpp. Its associated program output is at the end of
this file.
Here's the desired outcome
1 2 3 4 5 6 7 8 9 10
(1) Testing `cout << A': empty
(2) Testing `cin >> A':
Enter the polynomial (integer degree then double coefficients):
3 -1 2.09 -5.3 -0.98
(3) Second look at A: -1x^(3) +2.09x^(2) -5.3x^(1) -0.98
(4) Testing `Polynomial B(A)': -1x^(3) +2.09x^(2) -5.3x^(1) -0.98
(5) Testing `Polynomial C(2, clist)': +1x^(2) +4.5x^(1) +8
(6) Testing D = C: +1x^(2) +4.5x^(1) +8
(7) Testing A == B : TRUE
(8) Testing A == D : FALSE