Question: The following C + + code double getBalance ( ) { } void displayAccountInfo ( ) { std::cout Account Holder Mane: accountHolderNane std::end 1
The following C code double getBalancevoid displayAccountInfo std::cout "Account Holder Mane: accountHolderNane std::end;
;
int mainBankAccount account "John Doe", e;account.displayAccountInfo;std: :cout
Depositing $ std::end;std::cout "New Balance: account.getBalance std::end;std::cout
withdrawing $ std::end;std::cout "New Balance: account.getBalance std::end;std::cout
Withdrawing $ std::endl;std::cout "New Balance: account.getBalance std::end;std::cout
Final Account Info:" std::end;return ;
The 'getBalance' and 'displayAccountInfo' methods should be 'const' since they do not
modify the state of the object.
In the 'withdraw' method, an error message should be displayed if the withdrawal amount is
less than or equal to zero.
The code attempts to withdraw $ which should result in an error message about
insufficient funds but still prints a new balance statement afterward.
The 'minclude
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
