Advertisement
Dawid_PAr

Untitled

Aug 13th, 2019
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <string>
  4. using namespace std;
  5.  
  6. class Skarbonka
  7. {
  8. protected:
  9. float ile, kasa;
  10.  
  11. public:
  12. float putMoney()
  13. {
  14. kasa+=ile;
  15. return kasa;
  16. }
  17. float takeMoney()
  18. {
  19. kasa-=ile;
  20. return kasa;
  21. }
  22. };
  23.  
  24. class Ja : public Skarbonka
  25. {
  26. string imie;
  27. float ileKasy;
  28. public:
  29. void howMoney()
  30. {
  31. cout << ileKasy;
  32. }
  33. Ja(string i = "BRAK", float ii = 0)
  34. {
  35. imie = i;
  36. ile = ii;
  37. }
  38. };
  39. class Tata : public Skarbonka
  40. {
  41. string imie;
  42. float ileKasy;
  43. public:
  44. void howMoney()
  45. {
  46. cout << ileKasy;
  47. }
  48. Tata(string i = "BRAK", float ii = 0)
  49. {
  50. imie = i;
  51. ile = ii;
  52. }
  53. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement