-
Notifications
You must be signed in to change notification settings - Fork 0
/
CalculatorBody.cs
57 lines (56 loc) · 1.44 KB
/
CalculatorBody.cs
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Calculator
{
public class CalculatorBody
{
public Addition sum;
public Subtraction difference;
public Multiplication product;
public Division quotient;
public Exponentiation exponent;
public SquareRoot sqrt;
public UserInputOutput input;
public CalculatorBody()
{
this.sum = new Addition();
this.difference = new Subtraction();
this.product = new Multiplication();
this.quotient = new Division();
this.exponent = new Exponentiation();
this.sqrt = new SquareRoot();
this.input = new UserInputOutput();
}
public void AddNumbers()
{
sum.Calculate(1,2);
}
public void SubtractNumbers()
{
difference.Calculate(5,2);
}
public void MultiplyNumbers()
{
product.Calculate(1,2);
}
public void DivideNumbers()
{
quotient.Calculate(2,4);
}
public void ExponentNumbers()
{
exponent.Calculate(2,2);
}
public void SquareRootNumbers()
{
sqrt.CalculateUnary(25);
}
public void UserInput()
{
input.TakeUserInputCalcOutput();
}
}
}