-
Notifications
You must be signed in to change notification settings - Fork 0
/
Functions.cs
51 lines (50 loc) · 1.63 KB
/
Functions.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
using System;
using System.Collections.Generic;
namespace CalculatorCShaarp
{
internal class Functions
{
public void ChoiceFunction(String choice, List<String> History)
{
Operations operations = new Operations();
switch (choice)
{
case "1":
Console.WriteLine("Addition Selected");
History.Add("Addition");
operations.Addition();
break;
case "2":
Console.WriteLine("Subtraction Selected");
History.Add("Subtraction");
operations.Subtraction();
break;
case "3":
Console.WriteLine("Multiplication Selected");
History.Add("Multiplication");
operations.Multiplication();
break;
case "4":
Console.WriteLine("Division Selected");
History.Add("Division");
operations.Division();
break;
case "5":
Console.WriteLine("History Selected.");
gamesHistory(History);
break;
default:
Console.WriteLine("Invalid Option!");
Environment.Exit(1);
break;
}
}
public void gamesHistory(List<String>HistoryTracker)
{
foreach (var history in HistoryTracker)
{
Console.WriteLine(history);
}
}
}
}