Answered step by step
Verified Expert Solution
Question
1 Approved Answer
For this assignment you are to create a Python program with the following characteristics: 1 . Have a parent class called vehicles. 2 . Have
For this assignment you are to create a Python program with the following characteristics:
Have a parent class called vehicles.
Have two child classes called cars and trucks.
The vehicle class should have the following attributes:
a VIN number
b Odometer reading
c Color
d Make
e Model
f Owner which should be a list
The car class should have the following attributes:
a Carpet color
b Seat material
c List of exterior options
d Condition new good, fair, poor, junk
The truck class should have the following attributes
a Fuel type gas diesel, LNG
b Max load in pounds
c Number of axels
d Height in inches
e Registration status TF
The vehicle class should have the following methods:
a Update odometer reading
b Update color
c Change owner
d Display current owner
e Display all owners
The car class should have the following methods:
a Add exterior option
b Change condition
The truck class should have the following methods:
a Update max load
b Change registration status
The program should create instances of two trucks and three cars.
Make a list of all vehicles which only contains two lists, a list of cars and a list of trucks
Create a function to update the mileage of the vehicle with a random amount from miles
Using a FOR loop and calls to the mileage function, update the mileage for all vehicles
Create a function to change pounds to kilograms.
Using a FOR loop, print out all of the trucks information but have the max weight shown in kilograms.
Have the code appropriately commented.
Have the code be located in three files, nameHW namefunctions, nameclasses.
Submit the three code files and screen captures of the code executing.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started