sources:
CashOffice.cpp (2.1k)
CashOffice.h (1.4k)
O1_2.cpp (985 bytes)
PrimitiveTypes.h (421 bytes)
Room.cpp (1.8k)
Room.h (1.4k)


website:
more info here
studies/bauelemente/Softwarebauelemente-CodeO1-2/O1_2.cpp
download file

  1 ///////////////////////////////////////////////////////////
  2 // Softwarebauelemente I, Aufgabe O1.2
  3 //
  4 // author: Stephan Brumme
  5 // last changes: January 14, 2001
  6
  7
  8 #include "CashOffice.h"
  9 #include <iostream>
 10
 11
 12 using namespace std;
 13
 14
 15 void main()
 16 {
 17     CCashOffice myCashOffice(2,3,7);
 18     CCashOffice myCashOffice2(4,5,42);
 19
 20     myCashOffice.Show();
 21     myCashOffice2.Show();
 22
 23     // I wrote some lines twice to verify the overloaded operators
 24
 25     cout<<"Compare cashoffices ... "<<(myCashOffice==myCashOffice2)<<endl;
 26 // cout<<"Compare cashoffices ... "<<myCashOffice.EqualValue(myCashOffice2)<<endl;
 27
 28     cout<<"Now copy myCashOffice to myCashOffice2 ..."<<endl;
 29     myCashOffice2 = myCashOffice;
 30 // myCashOffice2.Copy(myCashOffice);
 31
 32     cout<<"Compare again ... "<<(myCashOffice==myCashOffice2)<<endl;
 33 // cout<<"Compare again ... "<<myCashOffice.EqualValue(myCashOffice2)<<endl;
 34
 35     cout<<"Verify the Copy-To-Itself protection ..."<<myCashOffice.Copy(myCashOffice)<<endl;
 36 }
 37