1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
#include <iostream>
using namespace std;
void checkAvail (string a, string b, int c, char d)
{
int standard [10] = {101, 102, 103, 104, 105, 106, 107, 108, 109, 110};
int moderate [10] = {111, 112, 113, 114, 115, 116, 117, 118, 119, 120};
int superior [10] = {201, 202, 203, 204, 205, 206, 207, 208, 209, 210};
int deluxe [10] = {211, 212, 213, 214, 215, 216, 217, 218, 219, 220};
int suite [5] = {301, 302, 303, 304, 305};
int studio [5] = {306, 307, 308, 309, 310};
// don't know how to erase the appropriate number of rooms temporarily.
// for example if the customer wants 5 standard rooms, the function
// shrinks the standard array to standard [5] instead of standard [10].
}
int main ()
{
string checkInDate;
string checkOutDate;
char type;
int rooms;
cout << "welcome" << '\n';
cout << "please enter check-in date: " << '\n';
cin >> checkInDate;
cout << "please enter check-out date: " << '\n';
cin >> checkOutDate;
cout << "how many rooms you want?: " << '\n';
cin >> rooms;
cout << "please choose the type of room you want: " << '\n';
cout << "1 for STANDARD, 2 for MODERATE, 3 for SUPERIOR, 4 for DELUXE, 5 for SUITE and 6 for STUDIO: " << '\n';
cin >> type;
checkAvail (checkOutDate, checkInDate, rooms, type);
}
|