Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please write c++ program per instructions and make sure to meet all the requirements. Please also add comments for the codes. Thanks. HW6 (Graded out
Please write c++ program per instructions and make sure to meet all the requirements. Please also add comments for the codes. Thanks.
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. 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