Create a superclass called Car. The Car class has the following fields and methods. int speed; float
Question:
Create a superclass called Car. The Car class has the following fields and methods. int speed; float regular Price; str color; float get Sale Price();
2. Create a subclass of Car class and name it as Truck. The Truck class has the following fields and methods. int weight; float get Sale Price(); # If weight>2000, 10% discount. Otherwise, a 20% discount.
3. Create a subclass of Car class and name it as Ford. The Ford-class has the following fields and methods int year; int manufacturer Discount; float get sale price(); # From the sale price computed from Car class, subtract the manufacturer discount.
4. Create a subclass of Car class and name it as Sedan. The Sedan class has the following fields and methods. int length; float get sale price(); # If length > 20 feet , 5% discount, Otherwise, 10% discount.
5. Create My Own Auto Shop class which contains a main() method. Perform the following within the main() method.
a. Create an instance of Sedan class and initialize all the fields with appropriate values. Use the super(...) method in the constructor for initializing the fields of the superclass.
b. Create two instances of the Ford-class and initialize all the fields with appropriate values. Use the super(...) method in the constructor for initializing the fields of the superclass.
c. Create an instance of Car class and initialize all the fields with appropriate values. Display the sale prices of all instance.