// This program determines the popularity of the various // combinations of drinks offered by a vending machine. // It uses a class that has an output method that outputs percentages as well // as frequency counts and has a method to output the most popular drink. // Barry Cornelius, 19 June 2000 import java.io. BufferedReader; import java.io. InputStreamReader; import java.io. IOException; public class VendingMachineProg { public static void main(final String[] pArgs) throws IOException { final BufferedReader tKeyboard = new BufferedReader(new InputStreamReader(System.in)); final int tNumberOfDrinks = 8; final VendingMachine tVendingMachine = new VendingMachine(tKeyboard, tNumberOfDrinks); tVendingMachine.setFrequencyCountsToZero(); tVendingMachine.readInSelectionsAndUpdateFrequencyCounts(); tVendingMachine.outputFrequencyCountsAndPercentages(); tVendingMachine.outputTheMostPopularDrink(); } }