/** * The TollPlaza creates three TollLane objects to test the TollLane class. * * @author J. O. Sugay * @version 2008.07.15 */ public class TollPlaza { public static void main (String args[]) { TollLane first = new TollLane (); TollLane second = new TollLane (); TollLane third = new TollLane (); first.letCarPass (true, 100.00, 25.00); first.letCarPass (true, 75.00, 50.00); first.letCarPass (false, 0.00, 10.00); second.letCarPass (false, 0.00, 20.00); second.letCarPass (false, 0.00, 110.00); second.letCarPass (true, 40.00, 80.00); second.letCarPass (true, 50.00, 55.00); second.letCarPass (true, 10.00, 15.00); third.letCarPass (true, 80.00, 35.00); third.letCarPass (true, 20.00, 20.00); third.letCarPass (false, 0.00, 45.00); third.letCarPass (false, 0.00, 75.00); System.out.println ("------------- Toll Plaza Report -------------"); System.out.print ("TOLL LANE 1: Php "); System.out.printf ("%.2f", first.getCash()); System.out.print (", " + first.getCars() + " cars, "); System.out.println (first.getViolators() + " violators"); System.out.print ("TOLL LANE 2: Php "); System.out.printf ("%.2f", second.getCash()); System.out.print (", " + second.getCars() + " cars, "); System.out.println (second.getViolators() + " violators"); System.out.print ("TOLL LANE 3: Php "); System.out.printf ("%.2f", third.getCash()); System.out.print (", " + third.getCars() + " cars, "); System.out.println (third.getViolators() + " violators"); System.out.println ("---------------------------------------------"); System.out.println (""); } }