Question: with java Write Java program code to realize the Figure.1 Description of the fields and methods of the classes as follows: 1. For Fields .
with javaWrite Java program code to realize the Figure.1 Description of the fields and methods of the classes as follows: 1. For Fields . Model-name: Model name of a vehicle Brand: Company to produce the model Owner: Owner of the vehicle (as object) Engine-type: Type of the engine. Classified by fuel type to be used such as gasoline, telohyd Tank-size: Size of fuel tank Unit is liter. Fuel consumption: Fuel consumption. Unitis km/liter numberOfSeats: Integer number of seats in a vehicle airConditionOn: Boolean status of air-condition's working ON/OFF. hasAutoDoor: Boolean status of a vehicle's having auto door power: Horse Power of a vehicle's engine. Diesel is public static final int-1, and gasoline is public static final int -2 2. For Methods . . Movable-distance(): Getting information of movable distance of a vehicle when the tank of the vehicle is filled tuby. costFor 100km/Petroleum-Price): Calculating cost for running 100Kms with the engine type and the petroleum type passed by as parameter. It will be different according to fuel and air-condition's status setAir ConditionON: Setting the air-condition of the vehicle to ON. You can guess other methods You have to add your owns methods, at least one odditional method for each class, other than mentioned above. Create appropriate setters and getters for classes. 3. Some conditions to write methods . . . The Car uses only gasoline engine. The Minivan can use engine of both gasoline and diesel. But the fuel consumption is same for both gasoline and diesel The Truck uses only diesel engine. The engine type Hybrid uses only gasoline. Default air-condition status is OFF, and the air-condition can be ON/OFF after instances being created by setAir Con ON/setAirConOFF methods. Default fuel consumption is considered when air-condition is OFF. Fuel consumption of the Car increased by 10% when air condition of the car is ON Fuel consumption of the Minivan and the Truck increased by 20% when air-condition of the car is ON. For Petroleum Price: Gasoline(get price from console Nis/liter, for instance 5.23 NIS/iter]), Diesel(get price from console NIS/liter, for instance 4.02 NIS/liter) Use Exception Handling to handle errors caused by mismatch filling type of Petroleum, throw an illegal argument exception Date: you have to use Calender class (Gregorian calender). Use String Builder class to deal with string manipulations when read from file. (splitting. uppercase, lowercase....etc) . . Appropriately implement the above hierarchy and stick to the following All Vehicle objects are comparable based on the costFor100km. Clone an instance of Vehicle object, without coning the owner of this Vehicle (set the owner to null for cloned object) Using deep cloning toString() method should be implemented in appropriate way in all Vehicle sub classes displaying all the information including the cost For 100Km
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
