-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
66 lines (65 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
using System;
using System.Collections.Generic;
namespace BankConsole
{
class Program
{
static void Main(string[] args)
{
var bank = new Bank();
try
{
string bankName = args[0];
bank.Name = bankName;
}
catch (IndexOutOfRangeException)
{
Console.WriteLine("Please supply a bank name!");
return;
}
while (true)
{
Console.Clear();
Console.WriteLine($"{bank.Name} Management System. Please Choose an Option:");
Console.WriteLine("----------------------------------------------------------");
Console.WriteLine("1: Add an Account");
Console.WriteLine("2. Print Mailing Labels");
Console.WriteLine("3. List All Accounts");
Console.WriteLine("4: List a Single Accounts Details");
Console.WriteLine("5. Create a Transaction");
Console.WriteLine("6: Exit");
Console.Write("You choice: ");
var choice = int.Parse(Console.ReadLine());
Console.Clear();
switch (choice)
{
case 1:
bank.AddAccount();
break;
case 2:
bank.PrintMailingLabels();
break;
case 3:
bank.ListAllAccounts();
break;
case 4:
bank.ListAccount();
break;
case 5:
bank.AddTransaction();
break;
case 6:
Console.WriteLine("Goodbye!");
break;
default:
Console.WriteLine("Choose one of the options!");
break;
}
if (choice == 6)
{
break;
}
}
}
}
}