-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
79 lines (76 loc) · 2.9 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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Program;
namespace Assignment01
{
public class Master
{
public static void Main(string[] args)
{
Console.ForegroundColor = ConsoleColor.Green;
Console.Write("Currently Running: ");
Console.ForegroundColor = ConsoleColor.DarkBlue;
Console.WriteLine("Assignment01");
bool flag = true;
while (flag)
{
Console.ForegroundColor = ConsoleColor.DarkYellow;
StringBuilder sb = new StringBuilder();
sb.AppendLine("\n\nPlease enter a choice from the given menu:");
sb.AppendLine(" 1. Simple Calculator");
sb.AppendLine(" 2. Highest Marks Finder");
sb.AppendLine(" 3. Sum of Array Elements");
sb.AppendLine(" 4. Swap two numbers");
sb.AppendLine(" 5. Area and Circumference of a Circle");
sb.AppendLine(" 6. Book Management System");
sb.AppendLine(" 7. Exit");
Console.WriteLine(sb.ToString());
Console.ResetColor();
int choice;
Console.Write("\nEnter your choice: ");
if (int.TryParse(Console.ReadLine(), out choice))
{
switch (choice)
{
case 1:
new SimpleCalculator();
break;
case 2:
new HMF();
break;
case 3:
new ArrElementSum();
break;
case 4:
new SwapNumbers();
break;
case 5:
new CircleMensuration();
break;
case 6:
new BMS();
break;
case 7:
flag = false;
break;
default:
Console.ForegroundColor = ConsoleColor.DarkRed;
Console.WriteLine("Enter a number between [1-7]");
break;
}
}
else
{
Console.ForegroundColor = ConsoleColor.DarkRed;
Console.WriteLine("Enter a valid integer");
}
}
Console.ForegroundColor = ConsoleColor.Magenta;
Console.WriteLine("\n\nThanks for using the app ;)\nExiting the program...");
Console.ReadKey();
}
}
}