-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
62 lines (59 loc) · 2.05 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
using System;
using System.ComponentModel.Design;
namespace thietkemenu
{
class Program
{
public static void Main()
{
int choice = 4;
while (choice != 0)
{
Console.WriteLine("Menu");
Console.WriteLine("1. Draw the triangle");
Console.WriteLine("2. Draw the square");
Console.WriteLine("3. Draw the rectangle");
Console.WriteLine("0. Exit");
Console.WriteLine("Enter your choice: ");
choice = Int32.Parse(Console.ReadLine());
MenuCommand(choice);
}
}
private static void MenuCommand(int choice)
{
switch (choice)
{
case 1:
Console.WriteLine("Draw the triangle");
Console.WriteLine("******");
Console.WriteLine("*****");
Console.WriteLine("****");
Console.WriteLine("***");
Console.WriteLine("**");
Console.WriteLine("*");
break;
case 2:
Console.WriteLine("Draw the square");
Console.WriteLine("* * * * * *");
Console.WriteLine("* * * * * *");
Console.WriteLine("* * * * * *");
Console.WriteLine("* * * * * *");
Console.WriteLine("* * * * * *");
Console.WriteLine("* * * * * *");
break;
case 3:
Console.WriteLine("Draw the rectangle");
Console.WriteLine("* * * * * *");
Console.WriteLine("* * * * * *");
Console.WriteLine("* * * * * *");
break;
case 0:
Environment.Exit(0);
break;
default:
Console.WriteLine("No choice!");
break;
};
}
}
}