|
CSIS 250 Spring 2000 Project #8
For each function and operator for the CPolynomial class, supply the following (each on a separate sheet):
Functions and operators for CPolynomial: 1. CPolynomial(void); 2. CPolynomial(const int &c); 3. CPolynomial(const double &c); 4. CPolynomial(const CTerm &cn); 5. CPolynomial(const CPolynomial &poly); 6. CPolynomial(const char *cp); 7. CPolynomial(char ch); 8. ~CPolynomial(void); 9. void insertAtTail(double coef, int expo); 10. void insertAtTail(const CTerm &cn); 11. void insertAtHead(double coef, int expo); 12. void insertAtHead(const CTerm &cn); 13. void populate(int n); 14. void deleteAll(void); 15. void deleteAt(CTerm *p); 16. void displayNodes(void) const; 17. void displayReverse(void) const; 18. int getCount(void) const; 19. int getDegree(void) const; 20. bool isOK(void) const; 21. CTerm * addressOfNodeAtPos(int pos) const; 22. CPolynomial & operator + (const CPolynomial &poly); 23. CPolynomial & operator - (const CPolynomial &poly); 24. CPolynomial & operator = (const CPolynomial &poly); 25. CPolynomial & operator * (const CPolynomial &poly); 26. CPolynomial & operator -() const; 27. CPolynomial & operator +() const; 28. void operator += (const CPolynomial &poly); 29. void operator -= (const CPolynomial &poly); 30. void operator *= (const CPolynomial &poly); 31. bool operator == (const CPolynomial &poly) const; 32. bool operator != (const CPolynomial &poly) const; 33. void simplify(void); 34. void sortDesc(void); 35. friend CPolynomial & operator * (const CTerm &cn, const CPolynomial &poly); 36. friend CPolynomial & operator + (const CTerm &cn, const CPolynomial &poly); 37. friend CPolynomial & operator - (const CTerm &cn, const CPolynomial &poly); 38. friend bool operator == (const CTerm &cn, const CPolynomial &poly); 39. friend bool operator != (const CTerm &cn, const CPolynomial &poly); 40. friend ostream & operator << (ostream &os, const CPolynomial &poly); 41. friend istream & operator >> (istream &os, CPolynomial &poly); 42. friend bool areCrossLinked(const CPolynomial &poly1, const CPolynomial &poly2); |