Question: Programming Exercises from chap 11 (q3 pg.575) Write a class named 'Car with data attributes: make, model, color and price initialize the value of price

 Programming Exercises from chap 11 (q3 pg.575) Write a class named

Programming Exercises from chap 11 (q3 pg.575) 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 object's 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 object's 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 Sample Output: nter the make: Honda nter the model: Civic nter the color: Blue nter the mileage: 202 s the car of transmission type Automatic ?(Yes/No) Yes ar information: lake: Honda odel: Civic olor: Blue ileage: 202.0 ransmission Type: True ar Condition: 80000 ar Type:Electric

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!