/*----------------------------------------------------------------------------------------- Program: The use of templates in the polynomial class. Date: November 3rd 2015 } ------------------------------------------------------------------------------------------*/ #include #include using namespace std; #define max_deg 10 template class Poly { private: // double x0, x1, x2 ; double x[max_deg + 1] ; public: Poly(); // syntax of how to declare the point. void print_poly() ; // double L2_norm() ; }; // Here is the constructor for this class. template Poly::Poly() { cout << "Please enter the " << deg + 1 << " coeffs for the Poly in decreasing order: " << endl; for (unsigned int i = 0 ; i < deg + 1 ; ++i) { cout << "Please input the coeff of x^"<< i << " " ; cin >> x[i] ; //++x; cout < void Poly::print_poly() { cout << " Printing the polynomial of degree "<< deg <> degree ; int d =4 ; switch ( degree ) {case 3: { Poly<3> p ; //d = degree ; //cout<< "3. here "<< d << endl; break; } case 4: { Poly<4> p ; // d = degree ; break; } default: cout<< "try again "< p; return 0; }