Advertisement
Guest User

Untitled

a guest
Jun 13th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 6.50 KB | None | 0 0
  1. {
  2.  
  3.             int z = 0;
  4.  
  5.             do {
  6.  
  7.  
  8.                 int quit;
  9.                 int secondchoice;
  10.                 cout<<"|      MENU' STATISTICHE      |"<<endl
  11.                     <<"1/  Statistica numero utenti totali"<<endl
  12.                     <<"2/  Statistica numero persone totali"<<endl
  13.                     <<"3/  Statistica numero compagnie totali"<<endl
  14.                     <<"4/  Statistica numero gruppi totali"<<endl
  15.                     <<"5/  Statistica numero amici e parenti per ogni utente"<<endl
  16.                     <<"6/  Statistica numero utenti nati dopo una certa data"<<endl
  17.                     <<"7/  Statistica numero dipendenti e consociate per ogni azienda"<<endl
  18.                     <<"8/  Statistica numero utenti per ogni gruppo"<<endl
  19.                     <<"9/  Statistica azienda con il maggiore numero di dipendenti"<<endl
  20.                     <<"10/ Statistica notizia con il maggior numero di apprezzanmenti"<<endl
  21.                     <<"11/ Statistica notizia con il maggior numero di indignazioni"<<endl
  22.                     <<"12/ Statistica utente con il maggior numero di amici"<<endl
  23.                     <<"13/ Statistica utente con il maggior numero di conoscenze"<<endl
  24.                     <<"14/ Statistica Età media delle persone"<<endl
  25.                     <<"15/ Torna indietro";
  26.  
  27.                     cin>>secondchoice;
  28.  
  29.                         switch (secondchoice) {
  30.  
  31.                             case 1:
  32.  
  33.                                 (*user_db).statisticNTotalUser();
  34.                                 break;
  35.  
  36.                             case 2:
  37.  
  38.                                 (*user_db).statisticNTotalPerson();
  39.                                 break;
  40.  
  41.                             case 3:
  42.  
  43.                                 (*user_db).statisticNTotalCompany();
  44.                                 break;
  45.  
  46.                             case 4:
  47.  
  48.                                 (*user_db).statisticNTotalGroup();
  49.                                 break;
  50.  
  51.                             case 5:
  52.  
  53.                                 quit = 0;
  54.                                 while (!quit) {
  55.                                     int choice;
  56.  
  57.                                     cout << "Please choose one of the following options : " << endl
  58.                                          << "[1] Statistica numero amici per ogni utente" << endl
  59.                                          << "[2] Statistica numero parenti per ogni utente" << endl
  60.                                          << "[3] Torna indietro";
  61.                                     cin >> choice;
  62.  
  63.                                     switch (choice) {
  64.                                         case 1:
  65.                                             (*user_db).statisticNFriend_User();
  66.                                             break;
  67.  
  68.                                         case 2:
  69.  
  70.                                             (*user_db).statisticNParents_User();
  71.                                             break;
  72.  
  73.                                         case 4:
  74.                                             quit = 1;
  75.                                             break;
  76.  
  77.                                         default:
  78.                                             cerr << "Option " << choice << " not valid" << endl;
  79.                                     }
  80.                                     break;
  81.                                 }
  82.  
  83.                             case 6:
  84.  
  85.                                 (*user_db).statisticNUserAfterSelectedData();
  86.                                 break;
  87.  
  88.                             case 7:
  89.  
  90.                                 quit = 0;
  91.                                     while (!quit) {
  92.                                         int choice;
  93.  
  94.                                         cout << "Please choose one of the following options : " << endl
  95.                                              << "[1] Statistica numero dipendenti per ogni azienda" << endl
  96.                                              << "[2] Statistica numero consociate per ogni azienda" << endl
  97.                                              << "[3] Torna indietro";
  98.                                         cin >> choice;
  99.  
  100.                                         switch (choice) {
  101.                                             case 1:
  102.                                                 (*user_db).statisticNEmployee_Company();
  103.                                                 break;
  104.  
  105.                                             case 2:
  106.  
  107.                                                 (*user_db).statisticNConsociate_Company();
  108.                                                 break;
  109.  
  110.                                             case 4:
  111.                                                 quit = 1;
  112.                                                 break;
  113.  
  114.                                             default:
  115.                                                 cerr << "Option " << choice << " not valid" << endl;
  116.                                         }
  117.                                         break;
  118.  
  119.                                     }
  120.                             case 8:
  121.  
  122.                                 (*user_db).statisticNUser_Group();
  123.                                 break;
  124.  
  125.                             case 9:
  126.  
  127.                                 (*user_db).statisticCompany_MaxEmployee();
  128.                                 break;
  129.  
  130.                             case 10:
  131.  
  132.                                 (*user_db).statisticMessage_MaxLike();
  133.                                 break;
  134.  
  135.                             case 11:
  136.  
  137.                                 (*user_db).statisticMessage_MaxDislike();
  138.                                 break;
  139.  
  140.                             case 12:
  141.  
  142.                                 (*user_db).statisticUser_MaxFriend();
  143.                                 break;
  144.  
  145.                             case 13:
  146.  
  147.                                 (*user_db).statisticUser_MaxMeet();
  148.                                 break;
  149.  
  150.                             case 14:
  151.  
  152.                                 (*user_db).statisticAverageAge();
  153.                                 break;
  154.  
  155.                             case 15:
  156.                                 quit = 1;
  157.                                 break;
  158.  
  159.                             default:
  160.                                 cerr << "Option " << secondchoice << " not valid" << endl;
  161.  
  162.                         }
  163.                     }
  164.                     while ( z == 0);
  165.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement