Advertisement
Guest User

Untitled

a guest
Dec 17th, 2014
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.07 KB | None | 0 0
  1. #include "TopList.h"
  2.  
  3. List<Data> l;
  4.  
  5. void menu()
  6. {
  7.     cout << "Welcome, press: "<< endl << "1 - Print All" << endl << "2 - find by surname" << endl << "3 - find by id" << endl << "9 - exit" << endl;
  8.  
  9.     while (true)
  10.     {
  11.         string request;
  12.         cout << "Enter you request: ";
  13.         cin >> request;
  14.  
  15.         if (request.find('1') == 0)
  16.         {
  17.             l.PrintAll();
  18.         }
  19.  
  20.         if (request.find('2') == 0)
  21.         {
  22.             string param;
  23.             cout << "Enter surname: ";
  24.             cin >> param;
  25.  
  26.             l.Find(param, true);
  27.         }
  28.  
  29.         if (request.find('3') == 0)
  30.         {
  31.             string param;
  32.             cout << "Enter id: ";
  33.             cin >> param;
  34.  
  35.             l.Find(param, false);
  36.         }
  37.  
  38.         if (request.find('9') == 0)
  39.         {
  40.             cout << "Thank from Porrowind!!!";
  41.             Sleep(800);
  42.             return;
  43.         }
  44.  
  45.         cout << endl;
  46.     }
  47. }
  48.  
  49. void main()
  50. {
  51.     Data data, data2;
  52.     SetData(data, 1, 18, "Egorov", "Michail", "Russia", "Not working", "Football", "5715543");
  53.     SetData(data2, 2, 19, "Nikitin", "Pavel", "Russia", "Not working", "DOTA", "...");
  54.  
  55.     l = List<Data>();
  56.     l.AddNode(data);
  57.     l.AddNode(data2);
  58.  
  59.     menu();
  60.  
  61.     //l.PrintAll();
  62.     //l.Find("1", false);
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement