Advertisement
HakdogForce

Untitled

Oct 21st, 2018
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.98 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int pin, new_p, x, y, npin, upin, userin, val, a, b, c, d;
  5. int pin4all[100];
  6.  
  7. int new_User();
  8. int choice();
  9. int old_User();
  10. int return_Menu();
  11.  
  12. int refresh_Time(){
  13. }
  14.  
  15. int choice(){
  16. cout << "PIYUTEK BANK\n" << endl;
  17. cout << " [1] New User\n [2] Registered User" << endl;
  18. cout << "\n----------------------------------" << endl;
  19. cout << "Select user type: ";
  20. cin >> userin;
  21.  
  22. if(userin == 1){
  23. new_User();
  24. }
  25. else{
  26. old_User();
  27. }
  28. }
  29.  
  30. int new_User(){
  31. cout << "\n-------REGISTERING NEW USER-------" << endl;
  32. cout << "Register your pin: ";
  33. cin >> pin;
  34. cout << "\n** You're now registered! **\n" << endl;
  35. cout << "----------------------------------" << endl;
  36. cout << "Enter now your pin: ";
  37. cin >> npin;
  38. if(pin == npin){
  39. system("cls");
  40. cout << "PIN NUMBER: " << npin << endl;
  41.  
  42. if(pin==npin){
  43. cout << "\nPin verification: YES" << endl;
  44. }
  45. else{
  46. cout << "\nPin verification: NO" << endl;
  47. }
  48.  
  49. cout << "\nSELECT PROCESS:\n" << endl;
  50. cout << " [1] Withdraw"<< endl;
  51. cout << " [2] Balance Inquiry"<< endl;
  52. cout << " [3] Change Pin" << endl;
  53. cout << " [4] Validate" << endl;
  54. cout << "\n----------------------------------" << endl;
  55. cout << "Choose process number you wish to perform: ";
  56. cin >> x;
  57. }
  58. else{
  59. cout << "Error! your pin doesn't match." << endl;
  60. }
  61. if (x==1){
  62. system("cls");
  63. cout <<" Wala pang Function!" << endl;
  64. }
  65. if (x==2){
  66. system("cls");
  67. cout << " Wala pang Function! " << endl;
  68. }
  69. if (x==3){
  70. system("cls");
  71. cout << "-------Changing Pin-------\n" << endl;
  72. cout << "You're now changing your pin: ";
  73. cin >> upin;
  74. upin == npin;
  75. system("cls");
  76. cout << "---------PIN CHANGED--------" << endl;
  77. cout << "\nSuccess! your new pin now is " << upin << endl;
  78. cout << "\n----------------------------\nChoose process you wish to proceed." << endl;
  79. cout << "1. Return to Main Menu" << endl;
  80. cout << "2. Back" << endl;
  81. cout << "3. Exit" << endl;
  82. cin >> y;
  83. if (y==1){
  84. system("cls");
  85. return choice();
  86. }
  87.  
  88. if (y==2){
  89. system("cls");
  90. cout << "You're now exiting this program.";
  91. return 0;
  92. }
  93. }
  94. if (x==4){
  95. system("cls");
  96. cout << "You are now going to validate your pin." << endl;
  97. cout << "Validate pin." << endl;
  98. cout << "\n----------------------------------" << endl;
  99. cout << "[1] Yes" << endl;
  100. cout << "[2] No" << endl;
  101. cout << "----------------------------------" << endl;
  102. cout << "\n----------PIN VALIDATING----------" << endl;
  103. cin >> val;
  104. if(pin==npin && val==1){
  105. system("cls");
  106. cout << "Success! your pin is now Validated." << endl;
  107. }
  108. if(pin!=npin || val==2){
  109. system("cls");
  110. cout << "Error! your pin don't match." << endl;
  111. }
  112. cout << "------------------------------\nChoose process you wish to proceed." << endl;
  113. cout << "1. Return to Main Menu" << endl;
  114. cout << "2. Back" << endl;
  115. cout << "3. Exit" << endl;
  116. cin >> y;
  117. if (y==1){
  118. system("cls");
  119. return choice();
  120. }
  121. if (y==2){
  122. system("cls");
  123. cout << "You're now exiting this program.";
  124. return 0;
  125. }
  126. return choice();
  127. }
  128. }
  129.  
  130. int return_Menu(){
  131.  
  132. }
  133.  
  134. int old_User(){
  135.  
  136. cout <<"Welcome back my dear customer!" << endl;
  137. cout << "Enter your pin: ";
  138. cin >> npin;
  139. system("cls");
  140. cout << "## SELECT PROCESS ##" << endl;
  141. cout << "[1] Withdraw"<< endl;
  142. cout << "[2] Balance Inquiry"<< endl;
  143. cout << "[3] Change Pin" << endl;
  144. cout << "[4] Validate" << endl;
  145. cout << "Choose process number: ";
  146. cin >> x;
  147.  
  148. if (x==1){
  149. system("cls");
  150. cout<<" Wala pang Function!" << endl;
  151. cout<<" ";
  152. }
  153. if (x==2){
  154. system("cls");
  155. cout << " Wala pang Function! " << endl;
  156. cout << " ";
  157. }
  158. if (x==3){
  159. system("cls");
  160. cout << "Changing Pin" << endl;
  161. cout << "You're now changing pin: ";
  162. cin >> upin;
  163. upin == npin;
  164. cout << "Your new pin now is " << upin << endl;
  165. cout << "****************************" << endl;
  166. cout << "----------------------------\nChoose process you wish to proceed." << endl;
  167. cout << "1. Return" << endl;
  168. cout << "2. Exit" << endl;
  169. cin >> y;
  170. if (y==1){
  171. system("cls");
  172. return choice();
  173. }
  174. if (y==2){
  175. system("cls");
  176. cout << "You're now exiting this program.";
  177. return 0;
  178. }
  179. }
  180. if(x==4){
  181. system("cls");
  182. if(pin==npin)
  183. {
  184. system("cls");
  185. cout << "Congratulations! You're now Validated." << endl;
  186. }
  187. else{
  188. system("cls");
  189. cout << "Error! your pin don't match!" << endl;
  190. }
  191.  
  192. cout << "------------------------------\nChoose process you wish to proceed." << endl;
  193. cout << "1. Return" << endl;
  194. cout << "2. Exit" << endl;
  195. cin >> y;
  196. if (y==1){
  197. system("cls");
  198. return main();
  199. }
  200. if (y==2){
  201. system("cls");
  202. cout << "You're now exiting this program.";
  203. return 0;
  204. }
  205. }
  206. }
  207.  
  208. int main(){
  209. choice();
  210. bool(true){
  211. return return_Menu();
  212. }
  213. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement