Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main(){
- cout<<"Testing parameter constructor"<<endl;
- Kniga lotr("The lord of the rings", 111222, 1000, 1955, "R.R. Tolkien");
- lotr.print();
- Kniga hp("Harry Potter", 222333, 1500);
- hp.setGodina(1991);
- hp.setAvtor("J.K. Rowling");
- hp.print();
- cout<<"Testing copy constructor"<<endl;
- Kniga hp2(hp);
- hp2.print();
- cout<<"Testing operator="<<endl;
- Kniga hp3;
- hp3=hp;
- cout<<"Testing operator <<"<<endl;
- cout<<hp3;
- cout<<"Testing operator >>"<<endl;
- Kniga got("GoT",333444,1750,1993,"R.R.Martin");
- //cin>>got;
- cout<<got;
- cout<<"Testing operator <"<<endl;
- if(hp<got){
- cout<<"HP<GOT"<<endl;
- }else{
- cout<<"HP>GOT"<<endl;
- }
- cout<<"Testing operator =="<<endl;
- if(hp==got){
- cout<<"HP==GOT"<<endl;
- }else{
- cout<<"HP!=GOT"<<endl;
- }
- cout<<"Testing static"<<endl;
- cout<<hp.cenaVoEvra()<<endl;
- Kniga::setEvro(61.7);
- cout<<hp.cenaVoEvra()<<endl;
- Biblioteka bm("Brakja Miladinovci", 3);
- cout<<"Testirame += operator"<<endl;
- try{
- bm+=hp;
- bm+=got;
- bm+=lotr;
- bm+=hp;
- }catch(SameBookException &objekt){
- objekt.print();
- }catch(MaxCapacity &objekt){
- objekt.print();
- }
- bm.printKnigi();
- cout<<"Testirame -= operator"<<endl;
- bm-=hp;
- bm.printKnigi();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement