// CS2310 Chapter 11 Exercise 1 // Taken from textbook p622 - 2 // // Write a C++ program for an apartment locator service. // Given the AptType declaration, write a function to // read values into the members of a variable of type // AptType. The struct variable is passed as an // argument. The order in which the data is read is the // same as that of the items in the struct. // // Name __________________________ SSN ___________________ // #include #include using namespace std; typedef struct { string landLord; string address; int bedRooms; float price; } AptType; void ReadMembers(AptType& apt) { // Write the body of the function: read values from keyborad // into the members of struct parameter apt. The order in // which the data is read is the same as that of the items // in the struct. } int main() { AptType apartment; // Read values into the members of apartment variable. ReadMembers(apartment); // Print out the values of members. cout << "The landlord is " << apartment.landLord << endl; cout << "The address is " << apartment.address << endl; cout << "The number of bedrooms is " << apartment.bedRooms << endl; cout << "The price is " << apartment.price << endl; return 0; }