Problem

You have been developing a BankAccount structure for Parkville Bank. Now you will develop...

You have been developing a BankAccount structure for Parkville Bank. Now you will develop a class that contains the fields and functions that a BankAccount needs. Create a class containing private fields that hold the account number and the account balance. Include a constant static field that holds the annual interest rate (3 percent) earned on accounts at Parkville Bank. Create three public member functions for the class, as follows:

» An enterAccountData()function that prompts the user for values for the account number and balance. Allow neither a negative account number nor one less than 1000, and do not allow a negative balance; continue to prompt the user until valid values are entered.

» A computeInterest()function that accepts an integer argument that represents the number of years the account will earn interest. The function displays the account number, then displays the ending balance of the account each year, based on the interest rate attached to the BankAccount.

» A displayAccount()function that displays the details of the BankAccount.

Create a main()function that declares an array of 10 BankAccount objects. After the first BankAccount object is entered, ask the user if he or she wants to continue. Prompt the user for BankAccount values until the user wants to quit or enters 10 BankAccount objects, whichever comes first. For each BankAccount entered, display the BankAccount details. Then prompt the user for a term with a value between 1 and 40 inclusive. Continue to prompt the user until a valid value is entered. Then pass the array of BankAccount objects, the count of valid objects in the array, and the desired term to a function that calculates and displays the values of each of the BankAccounts after the given number of years at the standard interest rate.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT