From 2ef7492cb6e5dca40afdf16561d6428baa9f68f9 Mon Sep 17 00:00:00 2001 From: HoxNorf <45671870+HoxNorf@users.noreply.github.com> Date: Tue, 14 Apr 2020 19:31:15 -0700 Subject: [PATCH] Update Display.java --- src/softwareengineeringproject1/Display.java | 72 ++++++++++++++++++-- 1 file changed, 68 insertions(+), 4 deletions(-) diff --git a/src/softwareengineeringproject1/Display.java b/src/softwareengineeringproject1/Display.java index aba36e5..51e29ef 100644 --- a/src/softwareengineeringproject1/Display.java +++ b/src/softwareengineeringproject1/Display.java @@ -21,7 +21,7 @@ public int screen() { int choice = myObj.nextInt(); - if (choice < 0 || choice > 4) { + if (choice < 1 || choice > 4) { System.out.println("Exit."); break; } @@ -31,7 +31,71 @@ public int screen() { } if (choice == 2) { - withdrawDisplay(); + boolean advance = false; + while (!advance){ + withdrawDisplay(); + System.out.print("Choose the option given: "); + int choiceWithdraw = myObj.nextInt(); + if (choiceWithdraw == 1){ +// if (amount - 20 >= 0){ +// deposit(20); +// advance = true; +// } else { +// System.out.println("Insufficient funds!"); +// } + } else if (choiceWithdraw == 2){ +// if (amount - 40 >= 0){ +// deposit(40); +// advance = true; +// } else { +// System.out.println("Insufficient funds!"); +// } + } else if (choiceWithdraw == 2){ +// if (amount - 40 >= 0){ +// deposit(40); +// advance = true; +// } else { +// System.out.println("Insufficient funds!"); +// } + } else if (choiceWithdraw == 3){ +// if (amount - 60 >= 0){ +// deposit(60); +// advance = true; +// } else { +// System.out.println("Insufficient funds!"); +// } + } else if (choiceWithdraw == 4){ +// if (amount - 80 >= 0){ +// deposit(80); +// advance = true; +// } else { +// System.out.println("Insufficient funds!"); +// } + } else if (choiceWithdraw == 5){ +// if (amount - 100 >= 0){ +// deposit(100); +// advance = true; +// } else { +// System.out.println("Insufficient funds!"); +// } + } else if (choiceWithdraw == 6){ +// if (amount - 120 >= 0){ +// deposit(120); +// advance = true; +// } else { +// System.out.println("Insufficient funds!"); +// } + } else if (choiceWithdraw == 7){ +// if (amount - 140 >= 0){ +// deposit(140); +// advance = true; +// } else { +// System.out.println("Insufficient funds!"); +// } + } else { + advance = true; + } + } } if (choice == 3) {//This is our keypad, user chose 3, send 3 back to the atm. @@ -93,7 +157,7 @@ public void withdrawDisplay() { } public void transferDisplay() { - System.out.println(" We will trasnfer here"); + System.out.println(" We will transfer here"); } -} \ No newline at end of file +}