Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- /* run this program using the console pauser or add your own getch, system("pause") or input loop */
- using namespace std;
- class Autor{
- private:
- string im;
- string naz;
- string gat;
- int o;
- public:
- Autor(){
- im="Krzysztof";
- naz="Krawczyk";
- gat="POP";
- o=5;
- }
- void wyswietl(){
- cout<<"Imie"<<setw(10)<<"nazwisko"<<setw(10)<<"Gatunek"<<setw(10)<<"Ocena"<<endl;
- cout<<im<<setw(10)<<naz<<setw(10)<<gat<<setw(10)<<o<<endl;
- }
- Autor(string a, string b, string c, int d):im(a), naz(b), gat(c), o(d){};
- void zmiana_o(){
- int no;
- cout<<"Podaj nową ocenę"<<endl;
- cin>>no;
- o=no;
- cout<<"Imie"<<setw(10)<<"nazwisko"<<setw(10)<<"Gatunek"<<setw(10)<<"Ocena"<<endl;
- cout<<im<<setw(10)<<naz<<setw(10)<<gat<<setw(10)<<o<<endl;
- }
- };
- class Plyta: public Autor{
- private:
- string tyt;
- int licz;
- float czas;
- int ocena;
- public:wyswietl(){
- cout<<"Tytul"<<setw(10)<<"licz"<<setw(10)<<"czas"<<setw(10)<<"ocena"<<endl;
- cout<<tyt<<setw(10)<<licz<<setw(10)<<czas<<setw(10)<<ocena<<endl;
- }
- Plyta(){
- tyt="Zlote przeboje";
- licz=10;
- czas=60;
- ocena=5;
- }
- void zmien_o(){
- int z;
- cout<<"podaj ocene"<<endl;
- cin>>z;
- ocena=z;
- cout<<"Tytul"<<setw(10)<<"licz"<<setw(10)<<"czas"<<setw(10)<<"ocena"<<endl;
- cout<<tyt<<setw(10)<<licz<<setw(10)<<czas<<setw(10)<<ocena<<endl;
- }
- };
- int main(int argc, char** argv) {
- Autor a;
- a.wyswietl();
- a.zmiana_o();
- Plyta p;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement