From c4e8866a8f66dc33a1515475454e76b64bc6910a Mon Sep 17 00:00:00 2001 From: siddhantdewani <47336797+siddhantdewani@users.noreply.github.com> Date: Sun, 24 Feb 2019 18:12:06 -0700 Subject: [PATCH] Update loanShark.java --- src/loanShark.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/loanShark.java b/src/loanShark.java index 0b366f6..c046ee6 100644 --- a/src/loanShark.java +++ b/src/loanShark.java @@ -18,6 +18,8 @@ public class loanShark { } public void loanMoney() { + boolean keepGoing = true; + while(keepGoing) { int loanAsk = 0; System.out.println("Please enter how much you would like to borrow"); Scanner keyboard = new Scanner(System.in); @@ -26,8 +28,20 @@ public class loanShark { player.setDebt(player.getDebt() + loanAsk); player.setMoney(player.getMoney() + loanAsk); } + String check; + System.out.println("Would you like to do any other business? Y / N?"); + Scanner keyboard = new Scanner(System.in); + check = keyboard.nextLine(); + + if(check.equalsIgnoreCase("Y")) { + keepGoing = true; + } + else if(check.equalsIgnoreCase("N")) { + keepGoing = false; + } + } } - public void addInterest() { - player.setDebt((int)(player.getDebt() * 1.01)); + public void removeInterest() { + player.setDebt((int)(player.getDebt() * 1.05)); } }