| 12 | } |
| 13 | |
| 14 | void MainMenu() |
| 15 | { |
| 16 | system("color 9E"); |
| 17 | char num; |
| 18 | char choice; |
| 19 | do |
| 20 | { |
| 21 | |
| 22 | bool checked = false; |
| 23 | string checkName, checkPassword; |
| 24 | accounts data; |
| 25 | accounts oldData[50]; |
| 26 | cout << "\n Choose what you want:"; |
| 27 | cout << "\n 1.Sign in"; |
| 28 | cout << "\n 2.Registration"; |
| 29 | cout << "\n 3.Exit"; |
| 30 | cout << "\n "; |
| 31 | choice = _getch(); |
| 32 | switch (choice) |
| 33 | { |
| 34 | case 49: |
| 35 | outData(oldData); |
| 36 | system("CLS"); |
| 37 | cout << "\n Please enter your name:"; |
| 38 | cout << "\n "; |
| 39 | cin >> checkName; |
| 40 | cout << "\n Please enter your password:"; |
| 41 | cout << "\n "; |
| 42 | cin >> checkPassword; |
| 43 | for (int i = 0; i < ::increaments; i++) |
| 44 | { |
| 45 | |
| 46 | if (oldData[i].name == checkName && oldData[i].password == checkPassword) |
| 47 | { |
| 48 | ::accountNum = i; |
| 49 | ::balance = oldData[i].balance; |
| 50 | ::borrow = oldData[i].borrowed; |
| 51 | checked = true; |
| 52 | } |
| 53 | } |
| 54 | if (checked) |
| 55 | { |
| 56 | do |
| 57 | { |
| 58 | system("CLS"); |
| 59 | cout << "\n Hello " << oldData[::accountNum].name << endl; |
| 60 | cout << "\n What would you like to do?" << endl; |
| 61 | cout << "\n 1.Actions with card" << endl; |
| 62 | cout << "\n 2.Check balance" << endl; |
| 63 | cout << "\n 0.Exit" << endl; |
| 64 | num = _getch(); |
| 65 | switch (num) |
| 66 | { |
| 67 | case 48: |
| 68 | break; |
| 69 | case 49: |
| 70 | Menu(oldData); |
| 71 | break; |
no test coverage detected