Question: define a class called Carspeed that will be used to track the velocity of the car after a specified time in seconds. Include private member
define a class called Carspeed that will be used to track the velocity of the car after a specified time in seconds. Include private member variables to track the current acceleration,and the engine number of the car.The class should have a constructor that initializes acceleration to zero and engine number to none.Includemember functions to sto the car,start the car,set the engin number,set car's current accelerationand calulate the car's velocity after a given time duration in seconds,since the acceleration was last reset.If the user tries to retrieve the car's velocity while the car is not in motion he or she should be promted to start it first.Use your class with a test program that creates several objects with diffrent acceleleration.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
