adventuretimeh

classebici

Jan 25th, 2021
642
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "Bicycle.h"
  2. #include <iostream>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. Bicycle::Bicycle() { cadence = 0; gear = 0; speed = 0; brand ="";}
  8. Bicycle::Bicycle(int c, int g, int s, string m)
  9. {
  10.  cadence = c; gear = g; speed = s; brand = m;
  11. }
  12. Bicycle::~Bicycle()
  13. {
  14. }
  15.  
  16. void Bicycle::changeCadence(int c) { cadence = c; }
  17. void Bicycle::changeGear(int g) { gear = g; }
  18. void Bicycle::speedUp(int inc) { speed += inc; }
  19. void Bicycle::applyBrakes(int dec) { speed -= dec; }
  20. void Bicycle::setbrand(string m) { brand= m; }
  21. void Bicycle::printStates()
  22. {
  23. cout << "cadence: " << cadence << " speed:" << speed << " gear:" << gear << " brand:" << brand << endl;
  24. }
RAW Paste Data