In addition, the class Car should contain data members that can hold the following
information:
Car type (should be one of Light, Small, Medium, Large, Hybrid, Luxury, Sport
types), purchase price, and usage (private or business).
Define necessary methods in the class Car.
The class Bus should include data members that hold the following information:
Bus type (should be one of Small, Medium, Large types), number of seats.
Define necessary methods in the class Bus.
Define an abstract class Vehicle in the file Vehicle.java, add data members that can
hold the following information:
Vehicle type (Car, Bus, Truck or Motor), Registration number (e.g. “ABC123”), engine
number (e.g. “H123456789”), owner’s name (e.g. “David Fox”), due date (e.g.
01/01/2011), length (e.g. 5.4 meters), gross mass (e.g. 2500 kg).
You may add necessary methods in the class defined above.
Define inheritance classes Car, Bus, Truck and Motor in the files Car.java, Bus.java,
Truck.java and Motor.java from the abstract class Vehicle.
In addition, the class Car should contain data members that can hold the following
information:
Car type (should be one of Light, Small, Medium, Large, Hybrid, Luxury, Sport
types), purchase price, and usage (private or business).
Define necessary methods in the class Car.
The class Bus should include data members that hold the following information:
Bus type (should be one of Small, Medium, Large types), number of seats.
Define necessary methods in the class Bus.
The class Truck should contain data members that can hold the following information:
Truck type (should be one of Light, Caravan, Trailer types), axis distance (e.g. 4.5 m) ,
price and usage (private or business).
Define necessary methods in the class Truck.
The class Motor holds extra information for price of the vehicle. Define necessary
methods in the class Motor.
Execute a script file connection.sql to create a relational table CONNECTION(FROMCITY, TOCITY, DISTANCE) and load sample data into it. The table contains information between the existing direct connections between the cities (FROMCITY, TOCITY) and the length of each connection (DISTANCE).