Scoring rubric: Requirement The main method prompts the user for all required input The main method gets all required input from the user The main method calls computeFutureValue method and passes required parameters Method header for computeFutureValue coded to show that the method returns the total interest and receives 3 parameters: investment amount, interest rate and number of months Method computeFutureValue correctly calculates each monthly interest and investment value Method computeFutureValue correctly calculates the total interest amount earned at the end of the months entered by user. Method computeFutureValue returns the total interest amount earned Method computeFutureValue correctly prints each monthly interest and investment value in the format of the sample output using a formatter String The main method prints the total interest amount earned (returned by the computeFutureValue method) Report headings and column headings printed as shown on sample run.
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
Financial Application:
• Write a
specified number of months and prints the report shown in the sample output.
• Given the annual interest rate, the interest amount earned each month is computed
using the formula:
Interest earned = investment amount * annual interest rate /1200 (=months * 100)
• Write a method, computeFutureValue, which receives the investment amount, annual
interest rate and number of months as parameters and does the following:
o Prints the interest amount earned each month and the new value of the
investment (hint: use a loop).
o Returns the total interest amount earned after the number of months specified by
the user.
The main method will:
o Ask the user for all input needed to call the computeFutureValue method.
o Call computeFutureValue
o Print the total interest amount earned by the investment at the end of the
number of months entered by the user.
Sample Program running
Enter the investment amount
10000
Enter the annual interest rate
5.75
Enter the number of months
18
Monthly Interest and Investment value
Month Interest Value
===== ======== =====
1 $47.92 $10,047.92
2 $48.15 $10,096.06
3 $48.38 $10,144.44
4 $48.61 $10,193.05
5 $48.84 $10,241.89
6 $49.08 $10,290.97
7 $49.31 $10,340.28
8 $49.55 $10,389.82
9 $49.78 $10,439.61
10 $50.02 $10,489.63
11 $50.26 $10,539.89
12 $50.50 $10,590.40
13 $50.75 $10,641.14
14 $50.99 $10,692.13
15 $51.23 $10,743.37
16 $51.48 $10,794.84
17 $51.73 $10,846.57
18 $51.97 $10,898.54
The total interest earned in 12 months is $898.54
Trending now
This is a popular solution!
Step by step
Solved in 6 steps with 4 images