Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2020
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. class Towar{
  8. public:
  9. double cena;
  10. };
  11.  
  12. class Fotel : public Towar{
  13. public:
  14. string nazwa;
  15. };
  16.  
  17. class Koszyk{
  18. private:
  19. vector<Towar> kosz;
  20. public:
  21. void Dodaj(Towar item){
  22. kosz.push_back(item);
  23. }
  24.  
  25. double Koszt(){
  26. double wynik;
  27. for (Towar x : kosz){
  28. wynik += x.cena;
  29. }
  30. return wynik;
  31. }
  32.  
  33.  
  34.  
  35.  
  36.  
  37. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement