Advertisement
Guest User

Untitled

a guest
Oct 19th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1.  
  2. #include "stdafx.h"
  3. #include "iostream.h"
  4.  
  5.  
  6. int main()
  7. {
  8. Samochod* s1 = new Samochod(9, false);
  9. Samochod* s2 = new Samochod(10, true);
  10. Mechanik* m = new Mechanic();
  11. Kierowca* k = new Kierowca();
  12.  
  13. cout << "s1 poziom paliwa " << s1->dajPoziomPaliwa() << "stanTechniczny: " << s1->dajStanTechniczny() << endl;
  14. if (k->czyMogeJechac(s1) == false) {
  15. cout << "s1 wyslany do naprawy " << endl;
  16. m->naprw(s1);
  17. cout << "s1 po naprawie poziom paliwa : " << s1->dajPoziomPaliwa() << "stan techniczny " << s1->dajStanTechniczny << endl;
  18. }
  19. else{
  20. cout << "s1 sprawny , moge jechac" << endl;
  21. }
  22.  
  23.  
  24.  
  25. cout << "s2 poziom paliwa " << s2->dajPoziomPaliwa() << "stanTechniczny: " << s2->dajStanTechniczny() << endl;
  26. if (k->czyMogeJechac(s2) == false) {
  27. cout << "s2 wyslany do naprawy " << endl;
  28. m->naprw(s2);
  29. cout << "s2 po naprawie poziom paliwa : " << s2->dajPoziomPaliwa() << "stan techniczny " << s2->dajStanTechniczny << endl;
  30. }
  31. else {
  32. cout << "s2 sprawny , moge jechac" << endl;
  33. }
  34.  
  35. delete s1, s2, m, k;
  36. int a;
  37. cin >> a;
  38.  
  39. return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement