Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Barbra Basiga 2010*/
- import AG_Banks.*;
- import java.io.*;
- public class AG_SadMan
- {
- public static void main(String args[]) throws IOException
- {
- AG_Account myAccount, myBills;
- System.out.println("How much money do you have?");
- BufferedReader myReader = new BufferedReader (new InputStreamReader(System.in));
- int amountOfMoney = Integer.parseInt(myReader.readLine());
- myAccount = new AG_Account(amountOfMoney);
- myBills = new AG_Account();
- System.out.print("If Sad Man had $" + amountOfMoney + " in his account, ");
- boolean isOver=false;
- while (myAccount.getbalance() >= 0 && !isOver)
- {
- isOver = myAccount.withdraw(100);
- myBills.deposit(amountWithdrawn);
- }
- int totalMoney = myAccount.getbalance();
- int totalBills = myBills.getbalance();
- System.out.println("then after paying his bills he is left with $" + totalMoney + " and the bank now has $" + totalBills + " of his money.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement