Advertisement
jbonanno

polynomialType.h

Jul 11th, 2017
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.02 KB | None | 0 0
  1. #ifndef H_polynomial
  2. #define H_polynomial
  3.  
  4. #include <iostream>
  5. #include "arrayListType.h"
  6.  
  7. using namespace std;
  8.  
  9. class polynomialType: public arrayListType<double>
  10. {
  11.     friend ostream& operator<<(ostream&, const polynomialType&);
  12.         //overload stream insertion operator
  13.     friend istream& operator>>(istream&, polynomialType&);
  14.         //overload stream extraction operator
  15. public:
  16.     polynomialType operator+(const polynomialType&);
  17.         //overload the operator +
  18.     polynomialType operator-(const polynomialType&);
  19.         //overload the operator -
  20.     polynomialType operator*(const polynomialType&);
  21.         //overload the operator *
  22.  
  23.     double operator() (double x);
  24.         //overload the operator () to evaluate the
  25.         //polynomial at a given point
  26.         //Postcondition: The value of the plynomial at x
  27.         //               is calculated and returned
  28.    
  29.     polynomialType(int size = 100);
  30.         //constructor
  31.  
  32.     int min(int x, int y);
  33.         //Function to return the smaller of x and y
  34.     int max(int x, int y);
  35.         //Function to return the larger of x and y
  36. };
  37.  
  38. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement