Question: I NEED A CORRECT ANSWER THIS TIME PLEASE.THIS IS MY TIRD TIME POSTING THIS QUESTION (Inheritance) Please write a general class named Vehicle which contains
I NEED A CORRECT ANSWER THIS TIME PLEASE.THIS IS MY TIRD TIME POSTING THIS QUESTION
(Inheritance) Please write a general class named Vehicle which contains make, model, color, year, mileage, weight and type information. Using the inheritance please write another class for gas vehicle (GasVehicle) and electric vehicles (ElectricVehicle). The GasVehicle class has an attribute named fuel tank capacity. However, the ElectricVehicle class has an energy storage in kwh. All the above classes must contains a method named print_vehicle_info which prints the vehicle information. This method must print different information for different classes. Please write a python script named q2.py which contains all the above classes, then create an instance of gas and electric vehicles and call the print_behicle_info method for each instance. $ python q2.py Vehicle Type: Gas Make: Honda Model: Accord Color: white Year: 2018 Miles driven: 5000 Weight: 3000 Fuel capacity (gallons): 90 Vehicle Type: Electric Make: Tesla Model: S Color: white Year: 2018 Miles driven: 2000 Weight: 4000 Energy Storage (Kwh): 1000
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
