import java.io.*; class UseDrinksMachine1 { public static void main(String[] args) throws NumberFormatException, IOException { SimpleDrinksMachine cheap = new SimpleDrinksMachine(25); SimpleDrinksMachine expensive = new SimpleDrinksMachine(80); BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); int amount; System.out.print("\nHow much do you want to put in the cheap machine? "); amount = Integer.parseInt(in.readLine()); cheap.addMoney(amount); System.out.print("When you press the Coke button you get "); System.out.println(cheap.pressCoke()); System.out.print("How much more do you want to put in? "); amount = Integer.parseInt(in.readLine()); cheap.addMoney(amount); System.out.println("The amount showing is: "+cheap.showMoney()+"p"); System.out.print("When you press the Fanta button you get "); System.out.println(cheap.pressFanta()); System.out.print("\nHow much do you want to put in the expensive machine? "); amount = Integer.parseInt(in.readLine()); expensive.addMoney(amount); System.out.print("How much more do you want to put in? "); amount = Integer.parseInt(in.readLine()); expensive.addMoney(amount); System.out.println("The amount showing is: "+expensive.showMoney()+"p"); System.out.print("When you press the Coke button you get "); System.out.println(expensive.pressCoke()); System.out.println(); } }