Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please help asap, (py) Code the program below: - The program must contain and use a main function that is called inside of if _
please help asap, (py)
Code the program below: - The program must contain and use a main function that is called inside of if _ name = main : - Create the abstract base class Vehicle with the following attributes - The methods with ABC next to them should be abstracted and overloaded in the child class - Create three child classes: car, truck, Motorcycle with these variables and methods: 1. In the _init _. methods of each child class, print out what kind of vehicle was created (0.5pts) Ee If a Car is created. print "A car was created." 2. The printDetaik 0 method should print out the TypeOPVehicle, Model, Manufacturer, and ManufacturingNumber (0.5pts) Ex. Manufacturer: Toyota Modet: al3s Wheels 4 Type of Vehicle: Car Seats: 4 Manufacturing Number 1 3. The checklnfoll method should allow a user to input data with a kevword related to each variable and check if the entered data matches the variable in the object, prining the varlable name along with True or False (0.5pts) Ex; object checkinfoiSeats 5 ) should print Seats + True or False depending on whether self seats is 5 4. In your main function create the following: (1.5pts) 1. Allist that contains five manufacturers. 2. A dict that contains the three types of vehicles as keys, each with a list of three different models. 3. A dict that contains the three types of vehicles as keys, each with a list of the number of seats that could be in each vehicle type (Car could have 2 to 5, Truck could have 2 to 4 . Motorcycle could have 1 to 2) 4. Create a dict calied totals that contains the three types of vehicles as keys, ench set to equal 0 1. manufacturens - (Toyota; GM, Ford, 2eep, Audin 2 ueats - [Car'i2.4.4), Thuck:23.4), Motorcycle:[1.21] 4. total = ICar'0, Thick: Matortele 0 ) Weh she above int and dicts create a blank bit and pooslate it with 5 instances of Cars. Hochs and Motercydes that all contan randemily selected data increating the respective totais her by 1 each time. The MamifacturineNumber should be eeval to the current totas ker * Select ane instance from the last and test its printDetaib0 and checkindo0. - A the end of the loos pont out the fotal mount of each vehicle created. - Output shoudd be similar to these. A car was created A car was created A truck was created! A truck wes created! A car mas created! Manufacturer: 0 M Model: i3 Whels: 4 Type of Vehicle: Car Seats: 5 Manufacturing Murber: 1 Model: False Car:-3, Truck: 2, Motorcycle: 0 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