-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMenuSelector.java
More file actions
85 lines (70 loc) · 2.88 KB
/
MenuSelector.java
File metadata and controls
85 lines (70 loc) · 2.88 KB
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
import java.util.Locale;
import java.util.Scanner;
public class MenuSelector extends Bank implements CurrencyGUI {
static boolean optionActive = true;
static boolean depositCurrencyMenuActive = true;
static boolean withdrawCurrencyMenuActive = true;
public void selectMenu(String mn) {
BankAccount bankAccount = new BankAccount();
SavedUsers savedUsers = new SavedUsers();
Scanner sc = new Scanner(System.in);
DepositSystem depositSystem = new DepositSystem();
WithdrawalSystem withdrawalSystem = new WithdrawalSystem();
BalanceSystem balanceSystem = new BalanceSystem();
OptionsMenu optionsMenu = new OptionsMenu();
CurrencyConverter currencyConverter = new CurrencyConverter();
String passVerificator = "";
switch (mn.toLowerCase(Locale.ROOT).trim()) {
case "deposit":
case "+":
while (depositSystem.depositSystem());
//depositSystem.depositSystem();
break;
case "withdraw":
case "-":
System.out.println("You Must Verify Your Password First!");
passVerificator = sc.next();
if (passVerificator.equals(bankAccount.getPassword())) {
System.out.println("Password Is Correct!");
while (withdrawalSystem.withdrawalSystem());
} else {
System.out.println("Password is incorrect!");
}
break;
case "balance":
case "=":
while (balanceSystem.balanceSystem());
//balanceSystem.balanceSystem();
break;
case "convert":
case "c":
System.out.println("You Must Verify Your Password First!");
passVerificator = sc.next();
if (passVerificator.equals(bankAccount.getPassword())) {
System.out.println("Password Is Correct!");
currencyConverter.convert();
} else {
System.out.println("Password is incorrect!");
}
break;
case "sign out":
case "signout":
case "/":
savedUsers.saveUserInfo();
System.out.println("Signing out..");
savedUsers.deletePreviousUserInfo();
innerMenuLoop = false;
break;
case "options":
case "o":
optionsMenu.optionsMenu();
break;
case "turnoff":
System.out.println("Shutting down..");
System.exit(0);
break;
default:
System.out.println("You have entered a wrong value!");
}
}
}