Answer:
Sure.
Two Cars
Here is the program with a few more blank lines:
class Car
{
. . . .
}
class MilesPerGallon
{
public static void main( String[] args )
{
Car car1 = new Car( 32456, 32810, 10.6 );
System.out.println( "Miles per gallon of car 1 is " + car1.calculateMPG() );
Car car2 = new Car( , , );
System.out.println( "Miles per gallon of car 2 is " + car2.calculateMPG() );
}
}
QUESTION 12:
Fill in the blanks for the second car, which has
- A starting odometer reading of 100000
- An ending odometer reading of 100300
- Gas consumption of 12.5 gallons.