Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5.  
  6. string GetInput()
  7. {
  8. string s = "";
  9.  
  10. cout << ">> ";
  11. getline(cin, s);
  12.  
  13. return s;
  14. }
  15. void mainMenu() {
  16.  
  17. cout << "Select an option" << endl;
  18. cout << "1. Add Entry" << endl;
  19. cout << "2. Edit Entry" << endl;
  20. cout << "Q. Quit" << endl;
  21.  
  22. string input = GetInput();
  23.  
  24. while (!(input.find_first_not_of("12qQ") == string::npos) || input.empty())
  25. {
  26. input = GetInput();
  27. }
  28.  
  29. if (input == "1") {
  30. cout << "Add Entry" << endl;
  31. //AddEntry();
  32. }
  33.  
  34. else if (input == "2") {
  35. cout << "Edit Entry" << endl;
  36. }
  37.  
  38. else {
  39. cout << "Quit" << endl;
  40. }
  41.  
  42. }
  43.  
  44. int main() {
  45.  
  46. cout << "===================================================" << endl;
  47. cout << "| Secure Database |" << endl;
  48. cout << "===================================================" << endl << endl;
  49.  
  50. mainMenu();
  51.  
  52. return 0;
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement