Question: language is python Code the program below. The program must contain and use a main function that is called inside of: If _name__=_main__ Create the



language is python
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 Methods Manufacturer print Details) - ABC Model checkinfo(**kwargs) Wheels Type OfVehicle Seats The methods with ABC next to them should be abstracted and overloaded in the child class Create three child classes Car Methods Variables ManufacturingNumber print Details) Truck Methods Variables ManufacturingNumber printDetails) Motorcycle Methods Variables ManufacturingNumber print Details() 1. In the __init_methods of each child class, print out what kind of vehide was created (1pts) Ex: If a Car is created, print "A car was created" 2. The printDetails() method should print out the TypeOfVehicle, Model, Manufacturer, and ManufacturingNumber (1pts) Ex. Manufacturer: Toyota Model: altis Wheels: 4 Type of Vehicle: Car Seats: 4 Manufacturing Number: 1 3. The checkInfo() 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 (1pts) Ex: object.checkInfo(Seats=5) should print Seats + True or False depending on whether self seats is 5 In your main function create the following: (2pts) 1. A list 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 Motorcyde could have 1 to 2) 4. Create a dict called totals that contains the three types of vehicles as keys, each set to equal o Ex. manufacturers = ['Toyota', 'GM", "Ford", "Jeep", "Audi"] models = {'Car':["X11','13','XFCE'), Truck':["Linux", "Unix", "FreeBSD"), "Motorcycle":["Triforce", "Mushroom", "Morphbail"}} seats = {'Car":[2,3,4,5), Truck":[2,3,4], "Motorcycle":[1,2]} total = 'Car":0, 'Truck":0, "Motorcycle":0} With the above list and dicts, create a blank list and populate it with 5 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. Select one instance from the list and test its printDetails() and checkInfo(). At the end of the loop print out the total amount of each vehide created. 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 Methods Manufacturer print Details) - ABC Model checkinfo(**kwargs) Wheels Type OfVehicle Seats The methods with ABC next to them should be abstracted and overloaded in the child class Create three child classes Car Methods Variables ManufacturingNumber print Details) Truck Methods Variables ManufacturingNumber printDetails) Motorcycle Methods Variables ManufacturingNumber print Details() 1. In the __init_methods of each child class, print out what kind of vehide was created (1pts) Ex: If a Car is created, print "A car was created" 2. The printDetails() method should print out the TypeOfVehicle, Model, Manufacturer, and ManufacturingNumber (1pts) Ex. Manufacturer: Toyota Model: altis Wheels: 4 Type of Vehicle: Car Seats: 4 Manufacturing Number: 1 3. The checkInfo() 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 (1pts) Ex: object.checkInfo(Seats=5) should print Seats + True or False depending on whether self seats is 5 In your main function create the following: (2pts) 1. A list 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 Motorcyde could have 1 to 2) 4. Create a dict called totals that contains the three types of vehicles as keys, each set to equal o Ex. manufacturers = ['Toyota', 'GM", "Ford", "Jeep", "Audi"] models = {'Car':["X11','13','XFCE'), Truck':["Linux", "Unix", "FreeBSD"), "Motorcycle":["Triforce", "Mushroom", "Morphbail"}} seats = {'Car":[2,3,4,5), Truck":[2,3,4], "Motorcycle":[1,2]} total = 'Car":0, 'Truck":0, "Motorcycle":0} With the above list and dicts, create a blank list and populate it with 5 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. Select one instance from the list and test its printDetails() and checkInfo(). At the end of the loop print out the total amount of each vehide created
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
