// copyright 1999 Brian J. Reithel, Ph.D. #include #include #define MAXBUILDINGS 2 class CBuilding { char BuildingName[151]; int SquareFeet; public: void info_in(void); void info_out(void); char* getname(void); int getsquarefeet(void); }; char* CBuilding::getname(){ return(BuildingName); } int CBuilding::getsquarefeet(){ return(SquareFeet); } void CBuilding::info_out(){ cout << "Building name: " << BuildingName << endl; cout << "Square Feet: " << SquareFeet << endl; cout << endl; } void CBuilding::info_in(){ char nl; cout << "Enter building name: "; cin.get(BuildingName,150,'\n'); cin.get(nl); cout << "Enter square feet: (whole numbers only) "; cin >> SquareFeet; cin.get(nl); } int main() { CBuilding buildings[MAXBUILDINGS]; int choice=0; int b; char nl; fstream buildingfile; while(choice<9){ cout << endl << endl << endl; cout << "1. Enter Building Information." << endl; cout << "2. Display Building Information" << endl; cout << "3. Save Building Database to Disk." << endl; cout << "9. Exit Building Manager." << endl; cout << "Please enter your choice (1-9): "; cin >> choice; cin.get(nl); cout << endl << endl; switch(choice) { case 1: for(b=0;b