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
|
void BookSeat(char seats[ROW][COL], int &numberTickets, double &totalPrice)
{
int userRow, userSeat = 0;
char YesNo;
double rowPrice[] = {50.00, 45.00, 40.00, 35.00, 30.00,
25.00, 20.00, 15.00, 12.00, 10.00,
8.00, 7.50, 7.00, 6.50, 5.00 };
do
{
cout << "Please choose the Row you would like to sit in (Price depends on Row) ";
cin >> userRow;
cout << "Please choose the Seat you would like to sit in: ";
cin >> userSeat;
if (seats[userRow][userSeat] == '*')
{
seats[userRow][userSeat] = '#';
numberTickets++;
totalPrice = rowPrice[userRow] * numberTickets;
}
else
{
cout << "Sorry, that seat is already taken. Would you like to select another seat (Y/N): " << endl;
cin >> YesNo;
}
} while (YesNo == 'Y');
}
|