class FleetTester
{
public static void main ( String[] args)
{
Fleet myCars = new Fleet( 1000, 1234, 10, 777, 999, 20 );
}
}
FleetThe cars that make up a fleet are constructed when the fleet is constructed. Here is the program with some additional work:
class Fleet
{
// data
Car town;
Car suv;
// constructor
Fleet( int start1, int end1, double gal1,
int start2, int end2, double gal2 )
{
town = ________________________ ;
suv = ________________________ ;
}
// method
}
class Car
{
. . . .
Car( int first, int last, double gals )
{
. . . .
}
}
class FleetTester
{
public static void main ( String[] args)
{
Fleet myCars = new Fleet( 1000, 1234, 10, 777, 999, 20 );
}
}