Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "monomial.h"
- monomial::monomial(double a,int b)
- {
- this->coef = a;
- this->deg = b;
- }
- monomial::~monomial()
- {
- }
- void monomial::setCoef(double c){
- this->coef = c;
- }
- double monomial::getCoef() const{
- return this->coef;
- }
- void monomial::setDeg(int d){
- this->deg = d;
- }
- int monomial::getDeg() const{
- return this->deg;
- }
- ostream& operator<<(ostream& out, const monomial& m){
- out << m.coef << "*X^" << m.deg;
- return out;
- }
Add Comment
Please, Sign In to add comment