Hello. What im tryin to do is answer the following.
Write a class named Car that has the following member variables:
yearModel, make, speed. In addition the class should have the following constructor and the other member functions
constructor-accept the cars year model make as arguments. an assign to the objects year, make also assign speed 0 to speed member.
Accessors to get the values stored in an object's yearModel make, speed
accelerate- should add 5 to the speed member variable each time it is called.
brake- subtract 5 from speed each time it is called.
Demonstrate the class in a program that creates a Car object and then calls the accelerate function five times. After each call to the accelerate function get the current speed of the car and display it. Then call the brake function five times after each call to the brake fuction, get the current speed. of the car and display it.
I have developed my code, And something is just not right, but im pretty close to getting it working. My other question is did i take it to far and answered the wrong question like should i let the user call the function or should i just automatically call accelerate and brake i thought about it to much that i confused my self. My code will be right after this message.