-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAddition.cpp
More file actions
43 lines (36 loc) · 913 Bytes
/
Addition.cpp
File metadata and controls
43 lines (36 loc) · 913 Bytes
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
/* Name: Gareth Postma
* MacID: postmagn
* Student Number: 001422248
* Name: Noah Zwiep
* MacID: zwiepn
* Student Number: 001424643
* Name: Mitchell Overbeeke
* MacID: overbeml
* Student Number: 001422018
* Description:
* */
#include <iostream>
#include "Addition.h"
#include "ArithmeticExpression.h"
#include "Expression.h"
using namespace std;
Addition :: Addition(Expression *left, Expression *right){
this->left = left;
this->right = right;
evaluate();
}
string* Addition::returnInput(){
return input;
};
string* Addition::getExp(){}
void Addition :: print(){
*left->getExp()="("+*left->getExp()+"+"+*right->getExp()+")";
}
string Addition :: evaluate(){
print();
value = to_string(stod(*(left->returnInput())) + stod(*(right->returnInput())));
return to_string(stod(*(left->returnInput())) + stod(*(right->returnInput())));
};
Addition :: ~Addition(){
//delete left;delete right;
}