import java.io.*; class AccountMain4 { public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); System.out.println("How much money do you want to start off with?"); int sum = Integer.parseInt(in.readLine()); Account acc = new Account(sum); Account husbandAcc=acc,wifeAcc=acc; System.out.println("How much money does Mr want to deposit?"); sum = Integer.parseInt(in.readLine()); husbandAcc.deposit(sum); System.out.println("How much money does Mrs want to deposit?"); sum = Integer.parseInt(in.readLine()); wifeAcc.deposit(sum); System.out.println("How much money does Mr want to withdraw?"); sum = Integer.parseInt(in.readLine()); if(husbandAcc.withdraw(sum)) System.out.println("Please take your money"); else System.out.println("Sorry, not enough in account"); System.out.println("How much money does Mrs want to withdraw?"); sum = Integer.parseInt(in.readLine()); if(wifeAcc.withdraw(sum)) System.out.println("Please take your money"); else System.out.println("Sorry, not enough in account"); System.out.println("Your balance is "+acc.balance()); } }