Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <fstream>
- using namespace std;
- int sitN,sitRow;
- string reservations[4][14];
- void displaySeats(char s[7][27])
- {
- for (int i = 0; i < 7; i++)
- {
- for (int j = 0; j < 27; j++)
- {
- cout << s[i][j];
- }
- cout << endl;
- }
- }
- void sits()
- {
- char seats[7][27] = {
- {'-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\\'},
- {'A','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*',' ',' ',' ',' ',' ',' ',' ','\\'},
- {'B','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*',' ',' ',' ',' ',' ',' ',' ',' ','\\' },
- {' ',' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '},
- {'C','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*',' ',' ',' ',' ',' ',' ',' ',' ', '/' },
- {'D','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*',' ',' ',' ',' ',' ',' ',' ','/' },
- { '-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','/' }
- };
- displaySeats(seats);
- }
- void MakeRes()
- {
- string name;
- char sitC;
- cout << "To make a reservation please enter your name" << endl;
- cin >> name;
- cout << "Please enter the sit that you want to reserve (Example b13)" << endl;
- cin >> sitC >> sitN;
- cout << "Thanks!" << endl << name << " the sit " << sitC << sitN << " is reserved for you." << endl;
- switch (sitC)
- {
- case 'a':
- sitRow = 0;
- break;
- case 'b':
- sitRow = 1;
- break;
- case 'c':
- sitRow = 2;
- break;
- case 'd':
- sitRow = 3;
- break;
- }
- }
- void CancelRes()
- {
- }
- void PrintResList()
- {
- }
- void PrintRes()
- {
- }
- void PrintEmpty()
- {
- }
- void menu()
- {
- int choice;
- cout << "Welcome to the menu, Please make your choice" << endl;
- cout << " 1-) Make a Reservation" << endl <<
- "2-) Cancel a Reservation" << endl <<
- " 3-) Print a Reservation List " << endl <<
- "4-) Print total number of seats reserved" << endl <<
- "5-) Print total number of empty seats" << endl;
- cin >> choice;
- if (choice == 1)
- MakeRes();
- else if (choice == 2)
- CancelRes();
- else if (choice == 3)
- PrintResList();
- else if (choice == 4)
- PrintRes();
- else
- PrintEmpty();
- }
- int main() {
- sits();
- MakeRes();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement