Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

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

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

Recommended Textbook for

Beyond Big Data Using Social MDM To Drive Deep Customer Insight

Authors: Martin Oberhofer, Eberhard Hechler

1st Edition

0133509796, 9780133509793

More Books

Students also viewed these Databases questions

Question

Consider some type of redress for the customer, such as a coupon.

Answered: 1 week ago

Question

Sell the quality of your brand or products.

Answered: 1 week ago