Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.87 KB | None | 0 0
  1. // Game Library
  2. // Exersize to create a library for favourite games
  3.  
  4. #include <iostream>
  5. #include <string>
  6. #include <vector>
  7. #include <algorithm>
  8.  
  9. using namespace std;
  10.  
  11. int main()
  12. {
  13.     cout << "Welcome to your Game Library\n\n";
  14.     cout << "Please choose from the following options:\n";
  15.     cout << "1 - Add a game\n";
  16.     cout << "2 - Remove a game\n";
  17.     cout << "3 - List games\n";
  18.     cout << "4 - Quit\n";
  19.  
  20.     string gameItems;
  21.     int mainChoice;
  22.     cin >> mainChoice;
  23.  
  24.     vector<string> gameList[30];
  25.  
  26.  
  27.         switch (mainChoice)
  28.         {
  29.         case 1:
  30.             cout << "\n\n\t Add a Game\n\n";
  31.             cout << "\nEnter a game title.\n";
  32.             cin >> gameItems;
  33.             gameList->push_back(gameItems);
  34.             cout << "Your Game Library now consists of: \n";
  35.             cout << gameList;
  36.            
  37.             break;
  38.         case 2:
  39.             break;
  40.         case 3:
  41.             break;
  42.         case 4:
  43.             break;
  44.         default:
  45.             cout << "Please enter 1-4";
  46.     }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement