I have this program, I went all over the place with it and I got confused. Its supposed to call the accelerate function 5 times and get the current speed of the car and then display it. Then, its supposed to call the brake function 5 times and then get the current speed of the car and then display it....Could someone fix it for me?
//
#include<iostream>
#include<cstring>
using namespace std;
//
class car
{
private:
int yearModel;
int speed;
string make;
public:
car(int, string);
string getMake();
int getModel();
int getSpeed();
int accelerate();
int brake()
int make();
};
car::car(int yearModelin, string makein)
{
yearModel= yearModelin;
make= makein;
speed=0;
}
string car::getMake()
{
return make;
}
int car::getModel()
{
return yearModel;
}
int car::getSpeed();
{
return speed;
}
int car::accelerate();
{
speed= speed+5;
}
int car::brake();
{
speed=speed-5;
}
}
int main()
{
car, car1 (1999, Honda);
for (i=0; i<5; i++)
{
car.accelerate();
cout<<car1.getSpeed();
}
return 0;
}