-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathProgram.cs
88 lines (78 loc) · 2.15 KB
/
Program.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
void cat()
{
Console.WriteLine("MEOW");
Console.WriteLine($"(=^・ェ・^=)");
}
void data()
{
Console.WriteLine("Enter any number from 0 to infinity");
int number = Convert.ToInt32(Console.ReadLine());
menu();
}
void AddTwoNum()
{
Console.WriteLine("Enter two numbers you would like to add.");
int num1 = int.Parse(Console.ReadLine());
int num2 = int.Parse(Console.ReadLine());
int sum = num1 + num2;
Console.WriteLine(sum);
Console.ReadKey();
menu();
}
void SubTwoNum()
{
Console.WriteLine("Enter two numbers you would like to subtract.");
int num1 = int.Parse(Console.ReadLine());
int num2 = int.Parse(Console.ReadLine());
int difference = num1 - num2;
Console.WriteLine(difference);
Console.ReadKey();
menu();
}
void MultiTwoNum()
{
Console.WriteLine("Enter two numbers you would like to multiply.");
int num1 = int.Parse(Console.ReadLine());
int num2 = int.Parse(Console.ReadLine());
int product = num1 * num2;
Console.WriteLine(product);
Console.ReadKey();
menu();
}
void DivideTwoNum()
{
Console.WriteLine("Enter two numbers you would like to divide.");
decimal num1 = decimal.Parse(Console.ReadLine());
decimal num2 = decimal.Parse(Console.ReadLine());
decimal qoutient = num1 / num2;
Console.WriteLine(qoutient);
Console.ReadKey();
menu();
}
void menu()
{
Console.WriteLine("Welcome, what would you like to do, 1.Surpise me, 2.Enter a Number, 3. Add two numbers together, 4.Subtract two numbers together, 5.Multiply two numbers together, 6. Divide two numbers togther, 7.End or quit.");
string response = Console.ReadLine();
if (response == "1")
cat();
if (response == "2")
data();
if (response == "3")
AddTwoNum();
if (response == "4")
SubTwoNum();
if (response == "5")
MultiTwoNum();
if (response == "6")
DivideTwoNum();
if (response == "7")
{
Console.WriteLine("Goodbye!");
System.Environment.Exit(0);
}
else
{
menu();
}
}
menu();