-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpolynomial.h
More file actions
57 lines (47 loc) · 1.31 KB
/
polynomial.h
File metadata and controls
57 lines (47 loc) · 1.31 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
Chris Ward
CSC220
7/2/15
Project 2 - Polynomials - polynomial.h header file
*/
#ifndef __POLYNOMIAL_H__
#define __POLYNOMIAL_H__
#include"numberbase.h"
#include<iostream>
using namespace std;
class Polynomial : public NumberBase{
private:
double *poly;
int order;
public:
Polynomial(int, double *);
Polynomial(const Polynomial&);
~Polynomial();
int getOrder();
void print();
void demo();
//used this add method to test out my addition logic
void polyAdd(int);
//Override =
Polynomial& operator=(const Polynomial&);
friend ostream& operator<<(ostream&, const Polynomial&);
// Override +
Polynomial operator+(int);
Polynomial operator+(double);
Polynomial operator+(const Polynomial&);
friend Polynomial operator+(int,const Polynomial&);
friend Polynomial operator+(double,const Polynomial&);
// Override -
Polynomial operator-(int);
Polynomial operator-(double);
Polynomial operator-(const Polynomial&);
friend Polynomial operator-(int,const Polynomial&);
friend Polynomial operator-(double,const Polynomial&);
// Override *
Polynomial operator*(int);
Polynomial operator*(double);
Polynomial operator*(const Polynomial&);
friend Polynomial operator*(int,const Polynomial&);
friend Polynomial operator*(double,const Polynomial&);
};
#endif