Advertisement
KingaGolas

zad 4 sprawdzian

Oct 26th, 2020 (edited)
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. class Posciel
  7. {
  8. public:
  9. float szerokosc;
  10. float dlugosc;
  11. string kolor;
  12. int cena;
  13. string nazwa_producenta;
  14.  
  15. Posciel (float=2, float=2.2, string="bialy", int=150, string="ikea");
  16.  
  17. void wyswietl ()
  18. {
  19. cout << "szerokosc poscieli:" << szerokosc <<endl<< "Dlugosc poscieli:"<< dlugosc <<endl<< "Kolor poscieli:" << kolor <<endl << "Cena Poscieli:" <<cena <<endl << "Producent poscieli:"<< nazwa_producenta << endl;
  20. }
  21. };
  22.  
  23. Posciel::Posciel (float s; float d; string b, int c, string n)
  24. {
  25. szerokosc=s;
  26. dlugosc=d;
  27. kolor=b;
  28. cena=c;
  29. nazwa_producenta=n;
  30. wyswietl();
  31. }
  32.  
  33. int main()
  34. {
  35. Posciel (2,2.2,"bialy",150,"ikea")
  36.  
  37. klient.wyswietl ();
  38.  
  39. return 0;
  40. }
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement