Savonarolla

Untitled

May 19th, 2020
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.68 KB | None | 0 0
  1. for (;;)
  2.     {
  3.         cout << "Please select your operation!" << endl;
  4.         cout << "1. Add" << endl;
  5.         cout << "2. Change" << endl;
  6.         cout << "3. Search & Sort" << endl;
  7.         cout << "4. Give or Return a Book "<< endl;
  8.         cout << "5. Show Data " << endl;
  9.         unsigned int operation{};
  10.         cin >> operation;
  11.         while (operation < 1 || operation > 5)
  12.         {
  13.             cin.clear();
  14.             cin.ignore(100000, '\n');
  15.             cout << "Please insert the correct operation number! " << endl;
  16.             cin >> operation;
  17.         }
  18.         switch (operation)
  19.         {
  20.             case 1:
  21.             {
  22.                 unsigned int addOperation = 3;
  23.                 cout << "1. Add a Book" << endl;
  24.                 cout << "2. Add a Reader" << endl;
  25.                 cin >> addOperation;
  26.                 while (addOperation < 1 || addOperation > 2)
  27.                 {
  28.                     cin.clear();
  29.                     cin.ignore(100000, '\n');
  30.                     cout << "Please insert the correct operation number! " << endl;
  31.                     cin >> addOperation;
  32.                 }
  33.                 switch (addOperation)
  34.                 {
  35.                     case 1: {
  36.                         fillBook(books, shelveSize);
  37.                         break;
  38.                     }
  39.                     case 2: {
  40.                         fillReader(people, personSize);
  41.                         break;
  42.                     }
  43.                 }
  44.             }
  45.                 break;
  46.             case 2:
  47.             {
  48.                 unsigned int changeOperation = 3;
  49.                 cout << "1. Change a Book" << endl;
  50.                 cout << "2. Change a Reader" << endl;
  51.                 cin >> changeOperation;
  52.                 while (changeOperation < 1 || changeOperation > 2)
  53.                 {
  54.                     cin.clear();
  55.                     cin.ignore(100000, '\n');
  56.                     cout << "Please insert the correct operation number! " << endl;
  57.                     cin >> changeOperation;
  58.                 }
  59.                 switch (changeOperation)
  60.                     case 1:
  61.                     {
  62.                     select(books,shelveSize);
  63.                     }
  64.                     break;
  65.                 case 2:
  66.                     {
  67.                     select(people,personSize);
  68.                     }
  69.                     break;
  70.             }
  71.                 break;
  72.             case 3:
  73.             {
  74.  
  75.             }
  76.                 break;
  77.             case 4:
  78.             {
  79.  
  80.             }
  81.                 break;
  82.             case 5:
  83.             {
  84.  
  85.             }
  86.                 break;
  87.         }
  88.     }
Add Comment
Please, Sign In to add comment