Guest User

Untitled

a guest
Aug 6th, 2018
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1.  
  2. #include<iostream>
  3. using namespace std;
  4.  
  5. bool valid (int, int);
  6. bool password (int, int, int );
  7. int currency (int, int);
  8. char ticket();
  9.  
  10. void main()
  11. {
  12. int username, password, flag, True, w, x, y, z, ans;
  13.  
  14. cout<<"Enter your username and password";
  15. cin>>username
  16. >>password;
  17.  
  18. do{
  19. cout<<"Incorrect input\n Your password or username is incorrect"
  20. <<"Enter username and password: ";
  21. cin>>username
  22. >>password;}while(password != 1002 && password != 1065 && password != 4569);
  23.  
  24. cout<<valid(w)
  25. <<password(x,y,z);
  26.  
  27. cout<<"Would you like your cash in lira or $ ?";
  28. cin>>ans;
  29.  
  30.  
  31.  
  32. }
  33.  
  34. bool valid(int w)
  35. {
  36. //how to check if it is a 4 digit number
  37. }
  38.  
  39. bool password (int x, int y, int z)
  40. {
  41. int password, answer, flag, True, False;
  42.  
  43. while(answer != -1)
  44. {
  45. if(password == 1002)
  46. flag = True;
  47.  
  48. else if(password == 1065)
  49. flag = True;
  50.  
  51. else if(password == 4569)
  52. flag = True;
  53.  
  54. else
  55. flag = False;
  56. cout<<"Re-enter your password or enter -1 to quit:";
  57. cin>>password;
  58. }
  59.  
  60. }
  61.  
  62. int currency (int amount)
  63. {
  64. int amount;
  65. cout<<"Choose which amount you would like to withdraw:\n";
  66.  
  67. if(amount == lira)
  68. cout<<" 1- $20, $60, $100";
  69. cin>>amount;
  70.  
  71. else
  72. cout<<" 2- LBP 20000, LBP 60000, LBP 100000";
  73. cin>>amount;
  74.  
  75. }
  76.  
  77. char ticket()
  78. {
  79. cout<<"Username: "
  80. <<"Date: "
  81. <<"Time:
  82. <<"Amount withdrawn: "
  83. <<"Amount remaining in the vault: "<<"$500000-currency(amount);
  84. }
Add Comment
Please, Sign In to add comment