#include #include "CPstring.h" // Name: Susan Rodger // // Date: 1/29/96 // // Purpose: To give travel info for traveling to Europe bool TravelPlace(string country) // postcondition: Determines which travel brochure to send // returns true if agency has a brochure, // otherwise returns false { if ("Switzerland" == country) { cout << "We'll send you our Switzerland brochure." << endl; } else if ("Germany" == country) { cout << "We'll send you our Germany brochure." << endl; } else if ("France" == country) { cout << "We'll send you our France brochure." << endl; } else { cout << "We do not have a brochure for " << country << endl; return false; } return true; } void TravelLodge(string place, double money, int years) // precondition: money >=0, years >=0 // postcondition: determines type of lodging { cout << "We'll also send you info on "; if (money > 200.0) { cout << "exquisite suites." << endl; if ("France" == place) { cout << "France has special rooms in palaces that might"; cout << endl << "be of interest to you." << endl; } } else if (money > 110.0) { cout << "grand hotels." << endl; } else if (money > 60.0) { cout << "hotels." << endl; } else if (money > 20.0) { if (years > 30) { cout << "adult "; } else { cout << "youth "; } cout << "hostels." << endl; } else { cout << "camping." << endl; } } int AskAge() // postcondition: returns an age { int numYears; cout << "How old are you?: "; cin >> numYears; return numYears; } string AskCountry() // postcondition: returns the name of a european country { string country; cout << "Enter european country: "; cin >> country; return country; } double AskAmount() // postcondition: returns the amount of money to spend on one night's lodging { double money; cout << "How much to spend per night for lodging?: "; cin >> money; return money; } int main() { string country; double amount; int age; cout << "Welcome to Exotic Travel Agency" << endl << endl; country = AskCountry(); // If have brochures for a country, then ask for lodging info if (true == TravelPlace(country)) { amount = AskAmount(); age = AskAge(); TravelLodge(country, amount, age); } return 0; }