Question: Create a superclass called Vehicle for your MyCar class and MyTruck class. Create a constant in your subclasses that stores information about the subclass. Let

Create a superclass called Vehicle for your MyCar class and MyTruck class. Create a constant in your subclasses that stores information about the subclass. Let the constant that is common to the MyCar class and MyTruck class is NUMER_OF_DOORS. Your superclass should be able to keep track of the number of objects created that inherit from the superclass. Create a method to print out the value of this class variable as well. a. Let that variable be number_of_vehicles b. You need to define instance variables; year, model, color, and current_speed c. Current_speed should be set to zero at the time of creation of the object. d. Other variables can be initialized at the time of creation of the object e. You need to define a function speed_up(number) that will increase the speed of the vehicle by the amount number

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 Programming Questions!