Question: Application: Write a program to predict the growth of a bank account due to compounded interest, with an additional bonus plan. First, ask the user
Application: Write a program to predict the growth of a bank account due to compounded interest, with an additional bonus plan. First, ask the user to specify the bank's base bonus and the threshold. The bonus will be added to the account balance at the end of each period if the current balance is greater than or equal to the threshold. Afterwards, allow the user to specify the initial account balance, and the annual interest rate. Then let the user specify the length of the investment in years and have the program compute the final account balance.
In addition to the final result, give the user the option to request a table describing the account balance at the end of each period. After displaying the final result, ask the user whether they want to do another calculation. If they choose to do that, then ask for all the information again. Otherwise, stop the program.
Calculations: Use these formulas for computing the interest and the new balance at the end of each period:
I Bold R
Bnew Bold I
where
R annual interest Rate
I Interest
Bold current balance, before compounding
Bnew current balance, after compounding
WARNING: These formulas are NOT in Java syntax, and you may NOT use single letter variable names except for loop control variables. Use descriptive names, and avoid obscure abbreviations. In addition, your program must also take into account additional bonuses offered by the bank. Each year, if the current balance is greater than the threshold, then add the base bonus to the account balance. For additional incentive, the bank also offers a bonus equal to ten times the base bonus if the balance is greater than ten times the threshold. Similarly, the bank adds times the base bonus if the balance is greater than times the threshold. That will be the new balance at the end of the year, and that balance is used to compute the balance
for the next year. Your program must repeat these calculations to compute how much interest is accumulated over successive years for the requested length of the investment. Do NOT use any onestep formula; it will not work with the bonuses.
Input and Output:
Check all user inputs for errors but assume that the user makes a numeric input when a number is requested, and no digits after the decimal point when the input is an integer If the user enters an invalid value, display an appropriate message and ask them to enter it again. Dollar amounts must be greater than or equal to zero. Interest rates can also be any nonnegative value. Allow interest rates greater than ; they are unlikely, but not impossible. Also check any choice from a list of options for a valid selection. You do not
have to check for a nonnumeric input to a request for a number. For outputs, in addition to displaying the answer to the user's question, your program must also give the user the option to have the growth displayed in a table. This table must have two columns: the year and the current balance. Use tabs to make the columns line up Display column headings above the numbers. The table must be optional so the user can choose to turn it on or off. If I want to know how much I have after years, I don't want to wait while the program displays lines, but for shorter problems I might like to see how the account is doing year by year.
Make your program easy to use. Start with a brief message identifying what the program does. Afterwards, include enough information in each input prompt so that the user will know what to enter without reading your code. Label the results thoroughly as well. Specify all units including whether the interest rate is a decimal percentage or a percent To make your messages easier to read and understand, print occasional blank lines, especially between the input prompts and the results.
Implementation:
Use the Scanner class for all input from the keyboard, and Systemout.printlnor print' for all output to the screen. This will be a consoleoriented application. This assignment will not involve defining new classes of objects. You must have at least two subprograms. These subprograms must match the following specifications exactly. For the first subprogram, compute and return the new balance after a given length of time. The subprogram will also be given the initial balance, the annual interest rate, the base bonus, and the threshold, as well as a boolean parameter indicating whether or not the user wants the table of periodic results. There will be no input from the user in either of these subprograms, and the only output is the table of intermediate results, if the user chooses to get it The second subprogram will repeat an input request until the user enters a nonnegative number. Input will be a String with the user prompt, and the output to the calling function will be the final entry a real number Repeat the input request until the user makes a valid entry.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
