#include <iostream>
class Tricycle
{
public:
Tricycle(int initialAge);
~Tricycle();
int getSpeed();
void setSpeed(int speed);
void pedal();
void brake;
private:
int speed;
};
Tricycle::Tricycle(int initialSpeed)
{
setSpeed(initialSpeed);
}
Tricycle::~Tricycle()
int Tricycle::getSpeed(){
return speed;
}
void Tricycle::pedal()
{
setSpeed(speed+1);
std::cout<<getSpeed();
}
void Tricycle::brake()
{
setSpeed(speed-1);
std::cout<<getSpeed();
}
int main(){
Tricycle wichita(5);
wichita.pedal();
wichita.pedal();
wichita.brake();
wichita.brake();
wichita.brake();
return 0;
}
As it turns out there's more than 1 stupid mistake. brake(). Thanks anyway.