// copyright 1999 Brian J. Reithel, Ph.D. class building { .. .. .. } int main(){ building onebldg; int choice=0; char nl; fstream bldgfile; char tempname[150]; int tempsqfeet; while(choice<9) { cout << "Main Menu" << endl << endl; cout << "1. Enter building information." << endl; cout << "2. Display building information." << endl; cout << "3. Load building data from disk." << endl; cout << "4. Save building data to disk." << endl; cout << "9. Exit." << endl; cout << "Enter your choice (1-9): "; cin >> choice; cin.get(nl); switch(choice) { case 1: onebldg.info_in(); break; case 2: onebldg.info_out(); break; case 3: bldgfile.open("building.dat",ios::in); bldgfile.get(tempname,150,'\n'); bldgfile.get(nl); onebldg.setname(tempname); bldgfile >> tempsqfeet; bldgfile.get(nl); onebldg.setsqfeet(tempsqfeet); bldgfile.close(); break; case 9: break; } } return(0); }