Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1- Use inheritance to implement the following classes: A : A Car that is a Vehic

ID: 3784697 • Letter: 1

Question

1- Use inheritance to implement the following classes:
A: A Car that is a Vehicle and has a name, a max_speed value and an instance variable called the

number_of_cylinders in its engine. Add public methods to set and get the values of these variables. When a car is printed (using the toString method), its name, max_speed and number_of_cylinders are shown.
B: An Airplane that is also a vehicle and has a name, a max_speed value and an instance variable called the number_of_engines it has. Add public methods to set and get the values of these variables. When an airplane is printed (using the toString method), its name, max_speed and number_of_engines are shown.

C: Write a VehicleDemo.java class that does the following:

1- Creates an instance of a Car and an Airplane class.

2- Assign values to the name, speed, number_of_cylinders (for the Car object) and

number_of_engines (for the Airplane object) variables.

3- Compares which vehicle goes faster and prints the result.

4- Prints the instances of the car and airplane classes.

2- Add the following changes to the above problem: A: Make the Vehicle an abstract class and add the following abstract method to it: double runningCost(int hour); Which receives the hours of operation as a parameter and returns the running cost of the vehicle. The Car andAirplane classes will implement this method as follows: 1- For the Car class, define a private double constant called COST PER CYLINDER PER HOUR 10.5. The runningCost of a Car will be equal to hours COST PER CYLINDER PER HOUR number of cylinders 2- For the Airplane class, define a private double constant called COST PERLENGINE PER HOUR- 25.3. The runningCost of an Airplane will be equal to: hours COST PER ENGINE PER HOUR number of engines B: Write an interface called maintainable, which has the following method: double maintenanceCost(double costPerUnit); t receives the cost per unit of an engine or cylinder and returns the maintenance cost. The Car and Airplane classes will implement this interface as follows: 1- For the Car class, the maintenance cost of a Car will be equal to: costPerUnit number of cylinders

Explanation / Answer

Pick up the capacity to actualize the protest arranged procedures in „Java.

Work on the basic capacities like subtraction, expansion and so forth not by utilizing import

bundle with the assistance of java programming dialect.

Implement technique over-burdening.

Implement constructor over-burdening.

Implement the properties of legacy and abrogating by utilizing super catchphrase.

Implement multithreading.

Do occasion dealing with by actualizing swings.

Draw an applet in java