Back

// Matt Kaliszewski
// Polynomial.h

#ifndef POLYNOMIAL_H
#define POLYNOMIAL_H

#include <iostream>
#include <string>
#include <vector>
using namespace std;

//================== polynomial class ==================//
class polynomial {
public:
       polynomial();
       polynomial(string p);
       int getDegree();
       void setDegree(int d);
       void setCoefficient(int value, int power);
       int evaluateForX(int x);
       friend polynomial operator*(polynomial poly1, polynomial poly2);
       friend ostream &operator<<(ostream &out, polynomial &p);
private:
       vector<int> coefficients;
       int degree;
};
//======================================================//

#endif

Back