Problem

You developed a BankAccount structure for Parkville Bank. The structure contains two field...

You developed a BankAccount structure for Parkville Bank. The structure contains two fields for the integer account number and double account balance. Add a third field that holds an annual interest rate earned on the account. Write a main()function in which you create two BankAccount objects. Add statements to the main()function to do the following:

» Prompt the user for account numbers, beginning balances, and interest rates for the two BankAccounts. The account number should be between 1000 and 9999; continue to reprompt the user until a valid account number is entered. Additionally, the account number for the second account cannot be the same account number as the first; continue to reprompt the user until an acceptable second account number is entered. The balance of neither account can be negative nor over $100,000; continue to reprompt the user until a valid balance is entered. The interest rate for each account must be between 0 and 0.15; reprompt the user until a valid interest rate is entered.

» Prompt the user to enter a term the accounts will be held, from 1 to 10 years; continue to prompt the user until the entry falls between these values. Also prompt the user for an automatic deposit amount per month (in dollars and cents) and an automatic withdrawal amount per month (also in dollars and cents). (Assume the term and the automatic payment will be the same for both accounts.) Then display a table that

forecasts the balance every month for the term of each account. Calculate each month’s balance as follows:

» Calculate interest earned on the starting balance; interest earned is 1/12 of the annual interest rate times the starting balance.

» Add the monthly automatic deposit.

» Subtract the monthly automatic withdrawal.

» Display the year number, month number, month-starting balance, and month-ending balance.

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