Question: [PYTHON] In class, we learned how inheritance allows us to create a general class first then later extend it to more specialized classes. Imagine you

[PYTHON]

In class, we learned how inheritance allows us to create a general class first

then later extend it to more specialized classes.

Imagine you run a car dealership. You sell several types of vehicles, including cars and trucks. To

set apart from the competition, you determine the price of a vehicle in you lot as $4,000number

of wheels a vehicle has. You also buy vehicles. You offer a flat rate - 10% of the miles driven on

the vehicle. The flat rates are: for cars $7,500, for trucks: $9,000

Your current sales system has a Car and a Truck class. Identify common attributes and methods

among those classes, and using the OOP principle of inheritance, create the parent class Vehicle.

The classes Car and Truck will inherit everything from Vehicle. (code available in your starter

code)

The functionality of the program should not change. Do not change any method name. Remember,

a parent class contains all attributes and methods common to the child classes.

[PYTHON] In class, we learned how inheritance allows us to create a

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!