forked from stefanxmiami/BankingApp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDepositSystem.java
More file actions
44 lines (40 loc) · 1.57 KB
/
Copy pathDepositSystem.java
File metadata and controls
44 lines (40 loc) · 1.57 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
import java.util.Locale;
import java.util.Scanner;
public class DepositSystem extends MenuSelector {
BankAccount bankAccount = new BankAccount();
Scanner sc = new Scanner(System.in);
public boolean depositSystem(){
System.out.println(currencyGUI);
do {
switch (sc.nextLine().toLowerCase(Locale.ROOT)) {
case "back":
case "b":
return false;
case "denar":
System.out.println("Enter Amount:\n");
bankAccount.depositBalanceDenar(sc.nextDouble());
return false;
case "pound":
System.out.println("Enter Amount:\n");
bankAccount.depositBalancePound(sc.nextDouble());
return false;
case "euro":
System.out.println("Enter Amount:\n");
bankAccount.depositBalanceEuro(sc.nextDouble());
return false;
case "dollar":
System.out.println("Enter Amount:\n");
bankAccount.depositBalanceDollar(sc.nextDouble());
return false;
case "yen":
System.out.println("Enter Amount:\n");
bankAccount.depositBalanceYen(sc.nextDouble());
return false;
default:
System.out.println("Please select a valid currency!");
break;
}
} while (depositCurrencyMenuActive);
return true;
}
}