Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Scanner inp = new Scanner(System.in);
- boolean bool = true;
- while (bool == true) {
- System.out.println("1 - DEPOSIT - 2 - WIDTHDRAW - 3 - TRANSFER - 4 - GET INTEREST - 5 - QUIT");
- if(inp.nextLine().equals("1")) {
- System.out.println("CHOOSE AN ACCOUNT: ");
- int acc = inp.nextInt();
- System.out.println("Insert amount: ");
- int amt = inp.nextInt();
- accounts.get(acc).deposit(amt);
- accounts.get(acc).showInfo();
- }
- else if(inp.nextLine().equals("2")){
- System.out.println("CHOOSE AN ACCOUNT: ");
- int acc = inp.nextInt();
- System.out.println("Insert amount: ");
- int amt = inp.nextInt();
- accounts.get(acc).widthdraw(amt);
- accounts.get(acc).showInfo();
- }
- else if(inp.nextLine().equals("3")){
- System.out.println("CHOOSE AN ACCOUNT: ");
- int acc = inp.nextInt();
- System.out.println("CHOOSE A BENEFICIARY: ");
- String ben = inp.nextLine();
- System.out.println("Insert amount: ");
- int amt = inp.nextInt();
- accounts.get(acc).transfer(ben, amt);
- accounts.get(acc).showInfo();
- }
- else if(inp.nextLine().equals("4")){
- System.out.println("CHOOSE AN ACCOUNT: ");
- int acc = inp.nextInt();
- accounts.get(acc).compound();
- accounts.get(acc).showInfo();
- }
- else if(inp.nextLine().equals("5")){
- System.out.println("THANK YOU AND HAVE A NICE DAY");
- bool = false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement