/** A test-class for 'Car'. (CLass 'Car' will be developed in-lecture.) * @author Ian Barland * @version 2008.Sep.22 */ public class CarTester { public static void main( String[] args ) { Car aHybrid = new Car(50); System.out.println( "Expect 0.000gal in tank: " + aHybrid.getGasInTank() ); aHybrid.addGas(10); System.out.println( "Expect 10.000gal in tank: " + aHybrid.getGasInTank() ); aHybrid.drive(0); System.out.println( "Expect 10.000gal in tank: " + aHybrid.getGasInTank() ); aHybrid.drive(500); System.out.println( "Expect 0.000gal in tank: " + aHybrid.getGasInTank() ); Car myCivic = new Car(30); // 30mpg myCivic.addGas(10); myCivic.drive(100); System.out.println( "Expect 6.666gal in tank: " + myCivic.getGasInTank() ); myCivic.addGas(10); myCivic.drive(100); System.out.println( "Expect 13.333gal in tank: " + myCivic.getGasInTank() ); myCivic.drive(400); System.out.println( "Expect 0.000gal in tank: " + myCivic.getGasInTank() ); } }