Advertisement
filomancio

main.cpp

Dec 18th, 2014
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.80 KB | None | 0 0
  1. #include "compito.h"
  2.  
  3. int main(){
  4.     //test costruttore/distruttore
  5.     {
  6.         Palazzo p(20);
  7.         cout << p  << endl;
  8.     }
  9.  
  10.      Palazzo p1(5);
  11.      cout << p1 << endl;
  12.  
  13.      //test costruttore di copia
  14.       Palazzo p2(p1);
  15.       cout << p2 << endl;
  16.        
  17.    //test aggiungi()
  18.       p1.aggiungi();
  19.       cout << p1 << endl;
  20.       p1.aggiungi();
  21.       cout << p1 << endl;
  22.  
  23.  
  24.      //test cambia()
  25.       p1.cambia(2, 1);
  26.       cout << p1 << endl;
  27.       p1.cambia(3, 3);
  28.       cout << p1 << endl;
  29.  
  30.  
  31.        //test operator!
  32.        cout << !p1 << endl;
  33.  
  34.       //test operator%=
  35.         Palazzo p3(5);
  36.         p3.aggiungi();
  37.         p3.aggiungi();
  38.         cout << p3 << endl;
  39.         p1%=p3;
  40.         cout << p1 << endl;
  41.  
  42.        
  43.      system("PAUSE");
  44.      
  45.     return 0;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement