import java.io.*; class UseDrinksMachine10 { // Demonstrating the use of the hot and cold drinks machine // type DrinksMachineF public static void main(String[] args) throws NumberFormatException, IOException { DrinksMachineF machine = new DrinksMachineF(40); BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); int amount; System.out.print("\nHow much do you want to put in the drinks machine? "); amount = Integer.parseInt(in.readLine()); machine.addMoney(amount); System.out.print("When you press the Coke button you get "); System.out.println(machine.pressCoke()); System.out.print("How much more do you want to put in? "); amount = Integer.parseInt(in.readLine()); machine.addMoney(amount); System.out.println("The amount showing is: "+machine.showMoney()+"p"); System.out.print("When you press the Tea button you get "); System.out.println(machine.pressTea()); } }