Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Rachunek
- {
- public:
- string nazwa_sklepu;
- float podatek;
- float cena;
- string nazwa_produktu;
- void wyswietl()
- {cout<<nazwa_sklepu<<endl;
- cout<<podatek<<endl;
- cout<<cena<<endl;
- cout<<nazwa_produktu<<endl;
- cout<<endl;}
- void oblicz() {
- int brutto;
- brutto=cena+(cena*podatek)/100;
- if (brutto<100)
- cout<<"Produkt zwolniony z vatu"<<endl;
- else
- cout<<brutto<<endl;
- }
- };
- int main()
- {
- Rachunek pierwszy;
- pierwszy.nazwa_sklepu="Comfort";
- pierwszy.podatek=23;
- pierwszy.cena=2000;
- pierwszy.nazwa_produktu="Szafka";
- pierwszy.wyswietl();
- Rachunek obiekt;
- obiekt.nazwa_sklepu="Lidl";
- obiekt.podatek=23;
- obiekt.cena=3000;
- obiekt.nazwa_produktu="Monitor";
- obiekt.oblicz();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement