Advertisement
Guest User

asda

a guest
Nov 20th, 2016
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. {
  2. cout<<"\n\t\tWELCOME TO ICE WORLD";
  3. cout<< endl;
  4. cout<< endl;
  5.  
  6. string u,p,u1,p1 ;
  7. u1="p";
  8. p1="1234";
  9.  
  10. int loginAttempt = 0;
  11.  
  12. while (loginAttempt < 3)
  13. {
  14.  
  15. cout<<"\n\t\tUSERNAME :" ;
  16. cin>>u;
  17. cout<< endl;
  18. cout<<"\t\tPASSWORD :";
  19. cin>>p;
  20. cout<< endl;
  21.  
  22.  
  23. if (u1==u & p1==p)
  24. menu();
  25. else
  26. cout << "Invalid login attempt. Please try again.\n" << '\n';
  27. loginAttempt++;
  28.  
  29. }
  30.  
  31.  
  32. if (loginAttempt == 3)
  33. {
  34. cout << "Too many login attempts! The program will now terminate.";
  35. return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement