Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- using namespace std;
- class autor
- {
- private:
- string imie, nazwisko, gatunek;
- float ocena;
- public:
- void disp()
- {
- cout << "Imie" << setw(10) << "Nazwisko" << setw(10) << "Gatunek" << setw(10) << "Ocena" << setw(5) << endl;
- cout << imie << setw(10) << nazwisko << setw(10) << gatunek << setw(10) << ocena << setw(5) << endl;
- }
- autor()
- {
- imie = "Krzysztof";
- nazwisko = "Krawczyk";
- gatunek = "POP";
- ocena = 5;
- cout << "Konstruktor domyslny klasy autor zostal wywolany" << endl;
- }
- autor(string i, string n, string g, float o)
- {
- imie = i;
- nazwisko = n;
- gatunek = g;
- ocena = o;
- cout << "Konstruktor parametryczny klasy autor zostal wywolany" << endl;
- }
- void zmiana()
- {
- float ocena2;
- cout << "Podaj nowa ocene wykonawcy:";
- cin >> ocena2;
- ocena = ocena2;
- }
- };
- int main(int argc, char** argv)
- {
- autor a1;
- a1.disp();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement