-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDivision.cpp
More file actions
45 lines (37 loc) · 942 Bytes
/
Division.cpp
File metadata and controls
45 lines (37 loc) · 942 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
41
42
/* 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 "Division.h"
#include "ArithmeticExpression.h"
#include "Expression.h"
using namespace std;
Division :: Division(Expression *left, Expression *right){
this->left = left;
this->right = right;
evaluate();
};
string* Division::returnInput(){
return input;
};
string* Division::getExp(){}
void Division :: print(){
*left->getExp()="("+*left->getExp()+"/"+*right->getExp()+")";
//cout<<"/"+*right+")";
};
string Division :: evaluate(){
print();
value = to_string(stod(*(left->returnInput())) / stod(*(right->returnInput())));
return to_string(stod(*(left->returnInput())) / stod(*(right->returnInput())));
};
Division :: ~Division(){
//delete left;delete right;
}