Answered step by step
Verified Expert Solution
Question
1 Approved Answer
CIS 2 8 0 X Lab assignment 1 Due: Wednesday, January 1 7 1 0 points Implement a class Account. An account has a balance,
CIS X
Lab assignment
Due: Wednesday, January
points
Implement a class Account. An account has a balance, functions to add and withdraw money, and a function to query the current balance. Charge a $ penalty if an attempt is made to withdraw more money than is available in the account.
Test your Account class by using the following main function.
int main
Account myaccount; Set up my account with $
myaccount.deposit;
myaccount.withdraw; Penalty of $ will apply
myaccount.withdraw;
cout "Account balance: myaccount.getbalance
;
myaccount.withdrawmyaccount.getbalance; withdraw all
cout "Account balance: myaccount.getbalance
;
return ;
Output
Account balance:
Account balance:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started