Question: python. Write a class named Car with data attributes: make, model, color and price initialize the value of price to integer. Also, implement a method

python. Write a class named Car with data attributes: make, model, color and price initialize the value of price to integer. Also, implement a method car type which returns a string value new. Next, write a class named ElectricCar that is subclass of Car class. The ElectricCar class should have a float data attribute for Mileage, and a Boolean data attribute indicating whether the Engine has Transmission or not. Override the price attribute and initialize it to a new integer value also override the car type method which should return a string value electric. Once you have written the classes, write the main program that prompts the user to enter data for each of the ElectricCar objects data attributes and create multiple object of the ElectricCar class. The number of objects to be created is determined by the user. Store the data in the object, then use the objects accessor methods to retrieve each of the object. Also, try to retrieve the overridden attribute and method by using the object and display them on the screen in a tabular form.

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!