What does this mean: This does not handle the end of month processing correctly. The monthly fee should only be deducted if the balance is below the minimum. Similarly, the interest should only be...

What does this mean: This does not handle the end of month processing correctly. The monthly fee should only be deducted if the balance is below the minimum. Similarly, the interest should only be added if the balance is above the minimum.coutewith an initial balance of S> id > anount; for(int i-e;i totalAccount;i++){ if (accounts[i]-getID()--id){ 136 137 138 139 148 141 142 143 isFound-true; accounts [i]->deposit(amount); pos-i; 144 145 146 147 148 if(lisFound){ cout"Invalid Account Number - "<"current balance="" is=""><>> id >> anount; bool isFound-false; for(int i-e;itotalAccount;i+){ if (accounts[i]-getID()--id){ 157 158 159 160 161 162 163 164 165 isFound-true; accounts (i]-withdraw(amount); pos i; 166 167 168 169 178 171 ir(lisFound){ coutce"Invalid Account Number - "ccidccendl; 172 173 elsef cout ccwithdraw $"ccamount c" from account recidccendl; coute"current balance is S"caccounts[pos]-getBalance()< cendl;="" 174="" 176="" 177="" else="" if="" (operationtype="" "balance"){="" int="" id;="" infile="">» id; int pos; 178 179 180 181 bool isFound-false; for (int i-e;ictotalAccount;i){ if (accounts[i]->getID()=-id){ isFound true; 182 184 185 cout"Current balance in account "ccid e" is S"caccounts[i] getBalance()closeMonth(); 195 196 197 198 199 else if (operationType "Report"){ for (int i-e;itotalAccount;i+){ cout « accounts[i]->accountString() « endl; 200 201 202 203 204 elsef coute"Unrecognised command string dunnyline; getline(infile, dumnyline); 205 "ccoperationTypeccendl; 208 afile.close(); 213 Input Wan t "/>
Extracted text: coutewith an initial balance of S"caccounts[totalAccount-1]-getBalance()> id > anount; for(int i-e;i totalAccount;i++){ if (accounts[i]-getID()--id){ 136 137 138 139 148 141 142 143 isFound-true; accounts [i]->deposit(amount); pos-i; 144 145 146 147 148 if(lisFound){ cout"Invalid Account Number - "<"current balance="" is=""><>> id >> anount; bool isFound-false; for(int i-e;itotalAccount;i+){ if (accounts[i]-getID()--id){ 157 158 159 160 161 162 163 164 165 isFound-true; accounts (i]-withdraw(amount); pos i; 166 167 168 169 178 171 ir(lisFound){ coutce"Invalid Account Number - "ccidccendl; 172 173 elsef cout ccwithdraw $"ccamount c" from account recidccendl; coute"current balance is S"caccounts[pos]-getBalance()< cendl;="" 174="" 176="" 177="" else="" if="" (operationtype="" "balance"){="" int="" id;="" infile="">» id; int pos; 178 179 180 181 bool isFound-false; for (int i-e;ictotalAccount;i){ if (accounts[i]->getID()=-id){ isFound true; 182 184 185 cout"Current balance in account "ccid e" is S"caccounts[i] getBalance()closeMonth(); 195 196 197 198 199 else if (operationType "Report"){ for (int i-e;itotalAccount;i+){ cout « accounts[i]->accountString() « endl; 200 201 202 203 204 elsef coute"Unrecognised command string dunnyline; getline(infile, dumnyline); 205 "ccoperationTypeccendl; 208 afile.close(); 213 Input Wan t
• RuODel<br>Savang av ete nulinterestRate),<br>Run Detg<br>Sup<br>men p<br>include dostream<br>tinclude cfstrean<br>3 eincludecstring<br>4 using nanespace std;<br>class Account{<br>int id;<br>double balance<br>publies<br>20<br>Account (){<br>id-0<br>id-<br>balance-.0;<br>21<br>12<br>14<br>Account (int newID, double initialBalance){<br>15<br>id - newID;<br>balance initialBalance;<br>16<br>;<br>17<br>18<br>19<br>veid setI0(int newID){<br>id- newID;<br>20<br>21<br>void settalance(double initiallalance){<br>balance initialialance;<br>23<br>24<br>int get1D()<br>return id;<br>25<br>26<br>27<br>28<br>29<br>double getsalance(){<br>return balance;<br>30<br>1<br>void withdraw(double amount){<br>balance - balance- amount;<br>32<br>33<br>34<br>35<br>36<br>37<br>38<br>void deposit(double aount){<br>balance balance mount,<br>39<br>virtual void closelonth()-<br>virtual string accountstring() - 0;<br>41<br>42<br>43 ):<br>46<br>47<br>48<br>44 elass Savings:publie Account{<br>double interest;<br>double winbalance;<br>public:<br>Savings()<br>49<br>se<br>void eloselonth(){<br>double pre getalance();<br>52<br>53<br>double newbalance - pre ((pre (interest/100.0))/12.0);<br>54<br>setBalance(newBalance);<br>56<br>string accountstring()<br>57<br>return
id initialBalance 108 e> miniunsalance > annualInterestRate; wSavings(); 109 11e savingiccount-setInterest(annualinterestRate); savingaccount-setMinbalance(minimunkalance); accounts(totalAccount) - savingaccount; accounts(totalAccount]-setID(ie); accounts(totalAccount]-settalance(initialBalance); tetalAccount-; cout Saving account nunber "cctotalAccount « created"cendl; coutwith an initial balance of S"ccaccounts[totalAccount-1)-getBalance()cendi; 111 113 114 115 116 117 118 119 12e 121 122 123 124 125 else if(operationType == "Checking") int id: double initialbalance,minimuntalance, monthlyfees; infile » id initialsalance >> minimunalance> monthlyFees: Checking "checkingaccount- new Checking(): checkingAccount-setMonthlyFee(monthlyFees); checkingiccount-setkinBalance(minimunBalance); accounts[totalAccount)- checkingaccount; accounts(totalAccount]-setID(ie): accounts[totalAccount]setBalance(initialBalance); tetalAccount cout "Checking account number "
Extracted text: • RuODel Savang av ete nulinterestRate), Run Detg Sup men p include dostream tinclude cfstrean 3 eincludecstring 4 using nanespace std; class Account{ int id; double balance publies 20 Account (){ id-0 id- balance-.0; 21 12 14 Account (int newID, double initialBalance){ 15 id - newID; balance initialBalance; 16 ; 17 18 19 veid setI0(int newID){ id- newID; 20 21 void settalance(double initiallalance){ balance initialialance; 23 24 int get1D() return id; 25 26 27 28 29 double getsalance(){ return balance; 30 1 void withdraw(double amount){ balance - balance- amount; 32 33 34 35 36 37 38 void deposit(double aount){ balance balance mount, 39 virtual void closelonth()- virtual string accountstring() - 0; 41 42 43 ): 46 47 48 44 elass Savings:publie Account{ double interest; double winbalance; public: Savings() 49 se void eloselonth(){ double pre getalance(); 52 53 double newbalance - pre ((pre (interest/100.0))/12.0); 54 setBalance(newBalance); 56 string accountstring() 57 return "SavingE account + to string(getID()) has balance of $"te_string(getsalance()): void setInterest(double interest){ this-interest-interest; 61 63 64 void setMintalance(double mintalance)( this-mintalanceminsalance; 65 66 69- class Checking public Account( 71 72 public: 73 double minalance; double monthlyree: : Checking(){ 74 75 void closelonth(){ double nealance getalance() setalance(newalance); 76 77 78 Ronthlyfee; string accountString() 81 return "Checking account+ to string(getID()) has balance of $"-to_string(getBalance()); 82 +" 83 84 85 void setMonthlyFee(double monthlyFee){ this nonthlyFee onthlyfee, 86 87 88 void settintalance(double minlalance){ this-minialance = minsalance; 89 91 92 ) 93 94 int nain(O Account accounts = new Account [10]; ifstrean infile; infile.open("bank2.txt"): 11 länfile ) cerr « "File cannont be opened" « endl; 95 96 97 98 99 100 101 102 else cout « "File Opened"endl; string operationType, int tetalaccount- hile(infileoperationType) 103 104 105 106 107 it(operationtype "Savings"H int id; double initialBalance,minimunalance, annualInterestRate; infile > id initialBalance 108 e> miniunsalance > annualInterestRate; wSavings(); 109 11e savingiccount-setInterest(annualinterestRate); savingaccount-setMinbalance(minimunkalance); accounts(totalAccount) - savingaccount; accounts(totalAccount]-setID(ie); accounts(totalAccount]-settalance(initialBalance); tetalAccount-; cout Saving account nunber "cctotalAccount « created"cendl; coutwith an initial balance of S"ccaccounts[totalAccount-1)-getBalance()cendi; 111 113 114 115 116 117 118 119 12e 121 122 123 124 125 else if(operationType == "Checking") int id: double initialbalance,minimuntalance, monthlyfees; infile » id initialsalance >> minimunalance> monthlyFees: Checking "checkingaccount- new Checking(): checkingAccount-setMonthlyFee(monthlyFees); checkingiccount-setkinBalance(minimunBalance); accounts[totalAccount)- checkingaccount; accounts(totalAccount]-setID(ie): accounts[totalAccount]setBalance(initialBalance); tetalAccount cout "Checking account number "
Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here