COSC-1336
Programming Assignment 6
Write a method that computes future investment value at a given interest rate for a specified number of years using the following formula:
futureInvestmentValue = investmentAmount x (1 + monthlyInterestRate)numberOfYears x 12
Use the following method header:
public static double futureInvestmentValue(double investmentAmount, double monthlyInterestRate, int years)
For example, futureInvestmentValue(10000, 5/1200, 5) returns 12833.59.
Write a test program that prompts the user to enter the investment amount (e.g., 1,000) and interest rate (e.g., 4%) and prints a table that displays future value for the years from 1 to 20.
Your program’s output should look like the sample shown in the screenshot below. Green text represents information entered by the user. Black text is produced by the program.
Store the source code in a file named InvestmentValueMethod<your_name>.java. For example, your instructor’s source code would be stored in a file named InvestmentValueMethodDoerschuk.java. In comments at the top of the source code file place the following:
<your name>
COSC 1336
Instructor: Dr. Doerschuk
Programming Assignment 6
Due: <as specified>
<brief description of the problem that the program was written to solve>
Please upload your source code and a screenshot of your output to Blackboard.


0 comments