import java.io.*; class Prog42 { // The right way to do an if-else statement... public static void main(String args[]) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); int balance = 100; System.out.print("Enter amount to withdraw: £"); int x = Integer.parseInt(in.readLine()); if (balance >= x) { // Perform withdrawal System.out.println("Withdrawing £" + x); balance = balance - x; } else { // Reject request System.out.println("You don't have £" + x); } System.out.println("Final balance: £" + balance); } }