Advertisement
Guest User

Untitled

a guest
Feb 27th, 2020
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. #include "Czas.h"
  2. void Czas::ustawSekundy(int _ile)
  3. {
  4. sekundy = _ile;
  5.  
  6. }
  7. void Czas::ustawMinuty(int _ile)
  8. {
  9.  
  10. minuty = _ile;
  11. }
  12. void Czas::ustawGodziny(int _ile)
  13. {
  14. minuty = _ile;
  15. }
  16.  
  17. int Czas::podajSekundy()
  18. {
  19. return sekundy;
  20. }
  21. int Czas::podajGodziny()
  22. {
  23. return godziny;
  24. }
  25. int Czas::podajGodziny()
  26. {
  27. return godziny;
  28. }
  29.  
  30.  
  31. #include <iostream>
  32. class Czas
  33. {
  34. private: //atrybut prywatny
  35. int sekundy; //dostępny tylko z poziomu klasy
  36. int minuty;
  37. int godziny;
  38. public:
  39. void ustawSekundy(int _ile); //metoda publiczna
  40. void ustawMinuty(int _ile);
  41. void ustawGodziny(int _ile);
  42. int podajSekundy();
  43. int podajMinuty();
  44. int podajGodziny();
  45. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement