Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please follow the instructions and meet all the requirements. Please add comments so I can understand it better. Thanks Enter below input to get outputs
Please follow the instructions and meet all the requirements. Please add comments so I can understand it better. Thanks
Enter below input to get outputs
1 111 H Solo 1000 1 222 M Spock 2000 1 222 4 1 333 C Kirk 3000 1 444 Chewbacca 4000 1 4 2 555 2 111 -10 3 111 1001 2 444 -20 2 222 10 3 666 3 333 2000 4 5
-------------------------------------------
HW6 (Graded out of 100) Design a bank account class named Account that has the following private member variables . accountNumber of type int balance of type double and the following public member functions ownerName of type string withdraw (amount) function to withdraw a specified amount from the account. The function should first check if there is sufficient balance in the account (greater or equal to the withdrawal amount). If the balance is sufficient, withdrawal is processed. Otherwise the withdrawal is not made and the function returns an error indication. deposit (amount) function to deposit a specified amount of money to the account. The function should first check if the deposit amount is positive. If it is positive, deposit is processed Otherwise the deposit is not made and the function returns an error indication. setAccountNumber (number): Amutator function that checks if the number is>0. If so it sets the accountNumber of the account to number. Otherwise, it does not set and returns an error indication. setownerName (name):A mutator function that checks if name is a string that consists only of letters and spaces. If so, it sets the ownerName of the account to name. Otherwise, it does not set and returns an error indication . . . setBalance (amount): A mutator function that checks if amount is >= 0, if so, it sets the . getAccountNumber ): An accessor function that returns the account number. This function . getOwnerName (): An accessor function that returns the owner name on the account. This . getBalance () An accessor function that returns the account balance. This function is later balance of the account to amount. Otherwise, it it does not set and returns an error indication. is later called by the displayAccountInfo ) function. function is later called by the displayAccountInfo () function. called by the displayAccountInfo () function
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