Question: 4. (Class 20 Points) Create a class called Account that represents customers' bank accounts. In this class, the balance member of type int represents the

4. (Class 20 Points) Create a class called Account that represents customers' bank accounts. In this class, the balance member of type int represents the account balance. Please implement the following member functions: (5 points) Member function creditBalance should add an amount to the current balance. (5 points) Member function debitBalance should withdraw money from the Account and ensure that the debit amount does not exceed the Account's balance. If it does, the balance should be left unchanged and the function should print a message "Debit amount exceeded account balance." (5 points) Member function getBalance should return the current balance. .(5 points) Member function setBalance should set balance to an initial balance. class Account public: Account int void setBalance( int ) int getBalance) int debitBalance ( int ); int creditBalance( int private: int balance; // bank account balance name
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
