import java.io.*; class AccountMain2 { public static void main(String[] args) throws IOException { try { 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); System.out.println("How much money do you want to deposit?"); sum = Integer.parseInt(in.readLine()); acc.deposit(sum); System.out.println("How much money do you want to withdraw?"); sum = Integer.parseInt(in.readLine()); if(acc.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()); } catch(NumberFormatException e) { System.out.println("Not a valid integer"); } } }