import java.io.*; class UseDrinksMachine8d { // A program to test & // Try and with different combinations of 0 and 1 Cokes and // 0, 1 or 2 Fantas public static void main(String[] args) throws NumberFormatException, IOException { DrinksMachineC machine = new DrinksMachineC(40); BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); int amount; System.out.print("How many Cokes should the machine start with? "); amount = Integer.parseInt(in.readLine()); machine.loadCokes(amount); System.out.print("How many Fantas should the machine start with? "); amount = Integer.parseInt(in.readLine()); machine.loadFantas(amount); System.out.print("How much do you want to put in the machine? "); amount = Integer.parseInt(in.readLine()); machine.addMoney(amount); System.out.println("Testing the machine with &"); if(machine.pressCoke().equals("Nothing") & machine.pressFanta().equals("Nothing")) System.out.println("No response from either button"); else { System.out.print("Now pressing the Fanta button gives: "); System.out.println(machine.pressFanta()); } } }