Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I'm new to Python and need help coding this question. Any comments would help me with understanding the main concepts. Thank you. Code the program

I'm new to Python and need help coding this question. Any comments would help me with understanding the main concepts. Thank you.

image text in transcribed

image text in transcribed

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: Variables Manufacturer Model Wheels TypeOfVehicle Seats Methods printDetais ABC checklnfo(**kwargs) The methods with ABC next to them should be abstracted and overloaded in the child class Create three child classes Variables Methods ManufacturingNumber printDetails() Truck Variables Methods ManufacturingNumber printDetails() Motorcycle Variables Methods ManufacturingNumber printDetails() In the_init_methods of each child class, print out what kind of vehicle was created IE: If a Car is created, print "A car was created" The printDetails() method should print out the TypeOfVehicle, Model, Manufacturer, and ManufacturingNumber The checklnfo() method should allow a user to input data with a keyword related to each variable and check if the entered data matches the variable in the object, printing the variable name along with True or False IE: object.checklnfo(Seats-5) should print SeatsTrue or False depending on whether self.seats is 5 In your main function create the following A list that contains five manufacturers A dict that contains the three types of vehicles as keys, each with a list of three different models under each 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) Create a dict called totals that contains the three types of vehicles as keys, each set to equal 0 With the above list and dicts, create a blank list and populate it with 100 instances of Cars, Trucks, and Motorcycles that all contain randomly selected data, increasing the respective totals key by 1 each time. The ManufacturingNumber should be equal to the current totals key With the list of 100 vehicles, loop through all of them and call the printData() method for each one. At the end of the loop print out the total amount of each vehicle created Finally, take five of the vehicles in the list and call their checklnfo() methods, passing to them respective random options from the pools of data you created at the start

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases 11th British National Conference On Databases Bncod 11 Keele Uk July 7 9 1993 Proceedings Lncs 696

Authors: Michael F. Worboys ,Anna F. Grundy

1993rd Edition

3540569219, 978-3540569213

More Books

Students also viewed these Databases questions

Question

9.4 Tests of the Population Proportion (Large Samples)

Answered: 1 week ago

Question

Q.No.1 Explain Large scale map ? Q.No.2 Explain small scale map ?

Answered: 1 week ago