12345678910111213141516171819202122232425262728293031323334353637
#include<iostream> #include<string> using namespace std; int main() { const int SZ=5; const char QUIT = 'z'; char answers[SZ]={'a','b','c','d','e'}; double price[SZ]={149.5,215.66,239.77,308.11,500.99}; string suite[]= Alyse , Botanical , Crimpson , Darlton , Edwardian; char selection; int x; int flag; cout << " Enter your choice of our hotel suites " << endl; for(x=0; x < SZ; ++x) cout << answers[x] << " for the " << suite [x] << " suite " << endl; cout << " Enter " << QUIT << " to quit "; cin >> selection; while (selection!=QUIT) { flag=0; for(x=0; x < SZ;++x) if (selection == answers[x]) { cout << " price per night for the " << suite[x] << " is $ " << price[x] << endl; flag=0; } if(flag=0) cout << "Sorry - invalid selection " << endl; cout << " enter next selection or " << QUIT << " to quit "; cin >> selection; } system("pause"); return 0; }
"double quotation marks"
if(flag==0)
string suite[]= "Alyse" , "Botanical" , "Crimpson" , "Darlton" , "Edwardian";