-
Notifications
You must be signed in to change notification settings - Fork 0
/
Form1.cs
70 lines (64 loc) · 1.69 KB
/
Form1.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
58
59
60
61
62
63
64
65
66
67
68
69
70
using System;
using System.Windows.Forms;
namespace SimpleCalculator
{
public partial class FormHome : Form
{
double numberOne;
double numberTwo;
double result;
public FormHome()
{
InitializeComponent();
}
private void buttonPlus_Click(object sender, EventArgs e)
{
getNumber();
Addition();
textBoxResult.Text = result.ToString();
}
private void buttonMinus_Click(object sender, EventArgs e)
{
getNumber();
Minus();
textBoxResult.Text = result.ToString();
}
private void buttonMultiply_Click(object sender, EventArgs e)
{
getNumber();
multiply();
textBoxResult.Text = result.ToString();
}
private void buttonDivition_Click(object sender, EventArgs e)
{
getNumber();
devide();
textBoxResult.Text = result.ToString();
}
private void getNumber()
{
numberOne = Convert.ToDouble(textBoxNumberFirst.Text);
numberTwo = Convert.ToDouble(textBoxNumberSecond.Text);
}
private double Addition()
{
result = numberOne + numberTwo;
return result;
}
private double Minus()
{
result = numberOne - numberTwo;
return result;
}
private double multiply()
{
result = numberOne * numberTwo;
return result;
}
private double devide()
{
result = numberOne / numberTwo;
return result;
}
}
}