| 104 | } |
| 105 | |
| 106 | void Borrow() |
| 107 | { |
| 108 | long double borrow; |
| 109 | cout << "\n In during time in our bank we have " << ::available << "$" << endl; |
| 110 | cout << "\n How much do you want to borrow?" << endl; |
| 111 | cout << "\n "; |
| 112 | cin >> borrow; |
| 113 | if (borrow == 0) |
| 114 | { |
| 115 | cout << "\n You entered 0 value so now you are redirected to the menu" << endl << endl; |
| 116 | Sleep(2000); |
| 117 | } |
| 118 | else if (borrow <= ::available && borrow > 0) |
| 119 | { |
| 120 | cout << "\n We can give you such amount of money." << endl; |
| 121 | cout << "\n Please wait for a while, while we are transfering money to your account" << endl; |
| 122 | Sleep(3000); |
| 123 | ::available = ::available - borrow; |
| 124 | ::balance = ::balance + borrow; |
| 125 | ::borrow = ::borrow + borrow; |
| 126 | cout << "\n Money is successfully transfered to your account." << endl << endl; |
| 127 | } |
| 128 | else if (::borrow < 0) |
| 129 | { |
| 130 | cout << "\n Error!" << endl; |
| 131 | cout << "\n Please enter valid amount of money!" << endl << endl; |
| 132 | } |
| 133 | else { |
| 134 | cout << "\n We are sorry but we cant give you such amount of money" << endl << endl; |
| 135 | } |
| 136 | cout << "\n "; |
| 137 | system("pause"); |
| 138 | } |
| 139 | |
| 140 | void Return() |
| 141 | { |