Guest User

Login.cpp

a guest
Jan 16th, 2015
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. // DoubleNumber.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5.  
  6.  
  7. int _tmain(int argc, _TCHAR* argv[])
  8. {
  9. return 0;
  10. }
  11.  
  12. #include <iostream>
  13.  
  14. using namespace std;
  15.  
  16. void login()
  17. {
  18. cout << "Login Successful." << endl;
  19. }
  20.  
  21. void rejectlogin()
  22. {
  23. cout << "Login Incorrect." << endl;
  24. }
  25.  
  26. void password()
  27. {
  28. cout << "Please Enter Your Numerical Password." << endl;
  29. int password;
  30. cin >> password;
  31. int correct_password;
  32. correct_password = 8876;
  33. if (password == correct_password)
  34. {
  35. login();
  36. }
  37. else
  38. {
  39. rejectlogin();
  40. }
  41. }
  42.  
  43. int main()
  44. {
  45. cout << "Please Enter Your Student Number." << endl;
  46. int username;
  47. cin >> username;
  48. int correct_username;
  49. correct_username = 1162888;
  50. if (username == correct_username)
  51. {
  52. password();
  53. }
  54. while (username != correct_username)
  55. {
  56. rejectlogin();
  57. }
  58. return 0;
  59. }
Advertisement
Add Comment
Please, Sign In to add comment