Repository navigation
Expand file tree
/
Copy pathBankMain.java
More file actions
58 lines (44 loc) · 1.65 KB
/
Copy pathBankMain.java
File metadata and controls
58 lines (44 loc) · 1.65 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
import java.util.*;
// Main class (Only handles menu)
public class BankMain {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
//creating object of BankService class
BankService service = new BankService();
int choice;
// Menu driven Program
do {
System.out.println("\n===== BANK MANAGEMENT SYSTEM =====");
System.out.println("1. Create Account");
System.out.println("2. Perform Transaction");
System.out.println("3. View Accounts");
System.out.println("4. Loan Services");
System.out.println("5. Create a Fixed Deposit");
System.out.println("6. Exit");
System.out.print("Enter choice: ");
choice = sc.nextInt();
switch (choice) {
case 1:
service.createAccount(); // create new account
break;
case 2:
service.performTransaction(); // deposit/withdraw
break;
case 3:
service.viewAccounts(); // display all accounts
break;
case 4:
service.loanMenu(); // loan related operations
break;
case 5:
service.fd(); // fixed deposit creation
break;
case 6:
System.out.println("Thank you!"); // exit case
break;
default:
System.out.println("Invalid choice!");
}
} while (choice != 6);
}
}