السلام عليكم
اتمنى تكونوا بصحه وعافيه
اتمنى شرح لهذاا السوال
مشكورين
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. :blush:
