Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions