Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. main()
  5. {
  6. int code;
  7. string username, password;
  8.  
  9. do
  10. {
  11. system("cls");
  12. cout << "-Main Manu-" << endl;
  13. cout << "[1]Login" << endl;
  14. cout << "[2]Exit" << endl;
  15.  
  16. cout << "\nEnter choice: ";
  17. cin >> code;
  18.  
  19. system("cls");
  20. if(code == 1)
  21. {
  22. cout << "-Login Menu-";
  23.  
  24. cout << "\nEnter Username: ";
  25. cin.ignore();
  26. getline(cin, username);
  27.  
  28.  
  29. cout << "Enter Password: ";
  30. getline(cin, password);
  31.  
  32. if(username == "user" && password == "pass")//Validation
  33. {
  34. cout << "Login Succesfully" << endl;
  35. system ("pause");
  36. do
  37. {
  38. system("cls");
  39. cout << "You are so ugly" << endl;
  40. cout << "Do you want to logout? Press 1: ";
  41. cin >> code;
  42.  
  43. if (code == 1)
  44. {
  45. }
  46. else
  47. {
  48. cout << "Invalid response. :)" << endl << endl;
  49. system ("pause");
  50. }
  51. }
  52. while (code != 1);
  53. }
  54. }
  55. }
  56. while (code != 2);
  57.  
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement