Advertisement
Guest User

zad1

a guest
Jan 23rd, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Zarulja
  5. {
  6. bool Stanje;
  7. public:
  8. Zarulja():Stanje(false){}
  9. Zarulja(bool s):Stanje(s){}
  10. void PaliGasi()
  11. {
  12. if (Stanje == false)
  13. Stanje = true;
  14. else
  15. Stanje = false;
  16. }
  17. bool VratiStanje()
  18. {
  19. return Stanje;
  20. }
  21. void Ispis() {
  22. if (Stanje == false)
  23. cout << "Zarulja je ugasena." << endl;
  24. else
  25. cout << "Zarulja je upaljena." << endl;
  26. }
  27. };
  28.  
  29. int main()
  30. {
  31. Zarulja Osram;
  32.  
  33. Osram.Ispis();
  34. Osram.PaliGasi();
  35. Osram.Ispis();
  36. Osram.PaliGasi();
  37. Osram.Ispis();
  38.  
  39. return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement