Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.61 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <fstream>
  4.  
  5. using namespace std;
  6.  
  7. int sitN,sitRow;
  8. string reservations[4][14];
  9.  
  10.  
  11. void displaySeats(char s[7][27])
  12. {
  13.     for (int i = 0; i < 7; i++)
  14.     {
  15.         for (int j = 0; j < 27; j++)
  16.         {
  17.             cout << s[i][j];
  18.         }
  19.         cout << endl;
  20.     }
  21. }
  22.  
  23. void sits()
  24. {
  25.     char seats[7][27] = {
  26.             {'-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\\'},
  27.             {'A','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*',' ',' ',' ',' ',' ',' ',' ','\\'},
  28.             {'B','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*',' ',' ',' ',' ',' ',' ',' ',' ','\\' },
  29.             {' ',' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '},
  30.             {'C','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*',' ',' ',' ',' ',' ',' ',' ',' ', '/' },
  31.             {'D','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*','*',' ',' ',' ',' ',' ',' ',' ','/' },
  32.             { '-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','/' }
  33.     };
  34.     displaySeats(seats);
  35. }
  36.  
  37. void MakeRes()
  38. {
  39.     string name;
  40.     char sitC;
  41.  
  42.  
  43. cout << "To make a reservation please enter your name" << endl;
  44. cin >> name;
  45. cout << "Please enter the sit that you want to reserve (Example b13)" << endl;
  46. cin >> sitC >> sitN;
  47. cout << "Thanks!" << endl << name << " the sit " << sitC << sitN << " is reserved for you." << endl;
  48.  
  49.     switch (sitC)
  50.     {
  51.         case 'a':
  52.             sitRow = 0;
  53.             break;
  54.         case 'b':
  55.             sitRow = 1;
  56.             break;
  57.         case 'c':
  58.             sitRow = 2;
  59.             break;
  60.         case 'd':
  61.             sitRow = 3;
  62.             break;
  63.     }
  64. }
  65.  
  66. void CancelRes()
  67. {
  68.  
  69. }
  70.  
  71. void PrintResList()
  72. {
  73.  
  74. }
  75.  
  76. void PrintRes()
  77. {
  78.  
  79. }
  80.  
  81. void PrintEmpty()
  82. {
  83.  
  84. }
  85.  
  86. void menu()
  87. {
  88.     int choice;
  89.     cout << "Welcome to the menu, Please make your choice" << endl;
  90.     cout << " 1-) Make a Reservation" << endl <<
  91.  
  92.     "2-) Cancel a Reservation" << endl <<
  93.  
  94.    " 3-) Print a Reservation List " << endl <<
  95.  
  96.     "4-) Print total number of seats reserved" << endl <<
  97.  
  98.     "5-) Print total number of empty seats" << endl;
  99.     cin >> choice;
  100.  
  101.     if (choice == 1)
  102.         MakeRes();
  103.     else if (choice == 2)
  104.         CancelRes();
  105.     else if (choice == 3)
  106.         PrintResList();
  107.     else if (choice == 4)
  108.         PrintRes();
  109.     else
  110.         PrintEmpty();
  111. }
  112.  
  113. int main() {
  114.  
  115.         sits();
  116.         MakeRes();
  117. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement