Update loanShark.java
This commit is contained in:
@@ -18,6 +18,8 @@ public class loanShark {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void loanMoney() {
|
public void loanMoney() {
|
||||||
|
boolean keepGoing = true;
|
||||||
|
while(keepGoing) {
|
||||||
int loanAsk = 0;
|
int loanAsk = 0;
|
||||||
System.out.println("Please enter how much you would like to borrow");
|
System.out.println("Please enter how much you would like to borrow");
|
||||||
Scanner keyboard = new Scanner(System.in);
|
Scanner keyboard = new Scanner(System.in);
|
||||||
@@ -26,8 +28,20 @@ public class loanShark {
|
|||||||
player.setDebt(player.getDebt() + loanAsk);
|
player.setDebt(player.getDebt() + loanAsk);
|
||||||
player.setMoney(player.getMoney() + 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;
|
||||||
}
|
}
|
||||||
public void addInterest() {
|
else if(check.equalsIgnoreCase("N")) {
|
||||||
player.setDebt((int)(player.getDebt() * 1.01));
|
keepGoing = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void removeInterest() {
|
||||||
|
player.setDebt((int)(player.getDebt() * 1.05));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user