Question: Please use c++ and do it as the question required. please. thanks Car Class Write a class named Car with these member variables: year an
Please use c++ and do it as the question required. please. thanks
Car Class Write a class named Car with these member variables: year an int that holds cars model year make a string that holds cars make speed an int that holds cars current speed The Car class should have these member functions: Constructor accepts cars year and make as arguments and assigns these values to year and make member variables also initializes speed to 0 Accessors allow values to be retrieved from objects year, make, and speed member variables accelerate add 5 to speed each time it is called brake should subtract 5 from speed each time it is called Demonstrate the class with a main program. Your program should Create a Car object Call the accelerate function five times After each call to accelerate, get the current speed of the car and display it Call the brake function five times After each call to brake, get the current speed of the car and display it
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
