-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathTerm.h
36 lines (28 loc) · 786 Bytes
/
Term.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef TERM_H
#define TERM_H
#include <string>
#include <sstream>
class Term {
public:
Term();
Term(const Term& orig);
~Term();
std::string print() const;
//getters&&setters
void set_exponent(const int expo);
void set_coefficient(const int coeff);
int get_exponent() const;
int get_coefficient() const;
const Term& operator=(const Term& rhs);
//boolean operators
bool operator== (const Term& rhs) const; //need to be const
bool operator!= (const Term& rhs) const;
bool operator> (const Term& rhs) const;
bool operator>= (const Term& rhs) const;
bool operator< (const Term& rhs) const;
bool operator<= (const Term& rhs) const;
private:
int exponent;
int coefficient;
};
#endif /* TERM_H */