/////////////////////////////////////////////////////////// // Softwarebauelemente I, Aufgabe M6.1 // // author: Stephan Brumme // last changes: November 23, 2000 // import cout to display some data #include #include "MCashOffice.h" // open std namespace using namespace std; void MCashOffice::Init(TCashOffice &cof, Ordinal nor, Ordinal ar, Ordinal noc) { cof.NumberOfCounter = noc; MRoom::Init(cof.Room, nor ,ar); } // Compares two exemplars // returns "true" if attributes of both are equal; "false" otherwise Boolean MCashOffice::EqualValue(TCashOffice cof1, TCashOffice cof2) { return ((cof1.NumberOfCounter == cof2.NumberOfCounter) && (MRoom::EqualValue(cof1.Room, cof2.Room))); } // Copies the attributes of roo2 // returns "true" if successful, "false" if no memory allocated Boolean MCashOffice::Copy(TCashOffice* cof1, TCashOffice cof2) { if ((cof1 == NULL) || (EqualValue(*cof1, cof2))) return false; cof1->NumberOfCounter = cof2.NumberOfCounter; MRoom::Copy(cof1->Room, cof2.Room); return true; } // Returns the NumberOfRooms attribute Ordinal MCashOffice::GetNumberOfRooms(TCashOffice cof) { return MRoom::GetNumberOfRooms(cof.Room); } // Sets the NumberOfRooms attribute void MCashOffice::SetNumberOfRooms(TCashOffice &cof, Ordinal nor) { MRoom::SetNumberOfRooms(cof.Room, nor); } // Returns the Area attribute Ordinal MCashOffice::GetArea(TCashOffice cof) { return MRoom::GetArea(cof.Room); } // Returns the NumberOfCounter attribute Ordinal MCashOffice::GetNumberOfCounter(TCashOffice cof) { return cof.NumberOfCounter; } // Sets the NumberOfCounter attribute void MCashOffice::SetNumberOfCounter(TCashOffice &cof, Ordinal nor) { cof.NumberOfCounter = nor; } // Displays the attributes void MCashOffice::Show(TCashOffice cof) { cout<<"Es sind "<