Advertisement
Nkzlxs

advancedSearch v3 function

Apr 7th, 2020
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.52 KB | None | 0 0
  1. void advancedSearch()
  2. {
  3.     int counter = 1;
  4.     string input_String[numbersOf_Attributes];
  5.     string output_String[numbersOf_Attributes] = {
  6.         "Employee Name", "Country", "Designation", "Gender", "Level of Education",
  7.         "Employee ID", "Date Of Birth", "Height", "Weight", "Years of working",
  8.         "Basic Salary", "Allowances"};
  9.     cout << "Search by the followings\n";
  10.     cin.clear();
  11.     cin.ignore(10000, '\n');
  12.     for (int n = 0; n < numbersOf_Attributes; n++)
  13.     {
  14.         cout << counter << ". ";
  15.  
  16.         cout << output_String[n];
  17.         if (n == 6)
  18.         {
  19.             cout << " in DD/MM/YYYY";
  20.         }
  21.         cout << " (Press Enter for none | \"< or >\" before numbers)";
  22.  
  23.         cout << endl;
  24.         cout << "-> ";
  25.         getline(cin, input_String[n]);
  26.         counter++;
  27.     }
  28.     /*
  29.     cout << "Inputted Strings:\n";
  30.     for (int v = 0; v < numbersOf_Attributes; v++)
  31.     {
  32.  
  33.         //cout << "Length Of Input->" << input_String[v].length() << " ";
  34.         cout << output_String[v] << ": " << input_String[v] << endl;
  35.     }
  36.     */
  37.     bool flag;
  38.     flag = matching_Cases(input_String);
  39.     //flag = matching_Cases(input_String, numbersOf_Attributes);
  40.     if (flag == false)
  41.     {
  42.         cout << "*****************************************************************" << endl;
  43.         cout << "\n\n\n\n\n";
  44.         cout << "Input Error\n";
  45.         cout << "\n\n\n\n\n";
  46.         cout << "*****************************************************************" << endl;
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement