| 97 | }; |
| 98 | |
| 99 | class CURR_ACCT : public ACCOUNT |
| 100 | { |
| 101 | private: |
| 102 | int amount; |
| 103 | int penalty = 2; |
| 104 | int balance = 0; |
| 105 | int withdraw; |
| 106 | |
| 107 | public: |
| 108 | void Deposit() |
| 109 | { |
| 110 | cout << " Enter your deposit balance: "; |
| 111 | cin >> amount; |
| 112 | |
| 113 | if (amount >= 100) |
| 114 | { |
| 115 | balance = balance + amount; |
| 116 | cout << " Successfully added!\n\n"; |
| 117 | } |
| 118 | else |
| 119 | { |
| 120 | cout << " Deposit cannot be less than 100$\n\n"; |
| 121 | system("pause"); |
| 122 | system("cls"); |
| 123 | Deposit(); |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | void Balance() |
| 128 | { |
| 129 | ACCOUNT::showdata(); |
| 130 | cout << " Balance: " << balance << endl |
| 131 | << endl; |
| 132 | } |
| 133 | |
| 134 | void Withdraw() |
| 135 | { |
| 136 | cout << " Enter the balance you want to withdraw: "; |
| 137 | cin >> withdraw; |
| 138 | } |
| 139 | |
| 140 | void Penalty() |
| 141 | { |
| 142 | if (balance - withdraw > 100) |
| 143 | { |
| 144 | balance = balance - withdraw; |
| 145 | cout << " Successfully done!\n\n"; |
| 146 | } |
| 147 | else if (balance - withdraw < 0) |
| 148 | { |
| 149 | cout << " You do not have such balance of money in your account!\n"; |
| 150 | cout << " Your balance is " << balance << endl; |
| 151 | system("pause"); |
| 152 | system("cls"); |
| 153 | Withdraw(); |
| 154 | } |
| 155 | else |
| 156 | { |
nothing calls this directly
no outgoing calls
no test coverage detected