Question: You need to write two classes for this problem. Name them Investment and InvestmentTest. The associated java files should be Investment.java and InvestmentTest.java. Make sure

You need to write two classes for this problem. Name them Investment and InvestmentTest. The associated java files should be Investment.java and InvestmentTest.java. Make sure the two java files are saved at the same location on your computer.

The InvestmentTest class should contain only a main method. In this main method, the program takes user inputs of three values investmentAmount in double, annualRate (annual interest rate) in double, and years in integer. The main method should also invoke a method from the Investment class to print the future value table for 30 years.

The Investment class should contain two methods. 1. futureInvestmentValue () use three parameters (investmentAmount, monthlyInterestRate, and years) to calculate and return the future value. The formula to calculate the future value is futureValue = investmentAmount * Math.pow(1 + monthlyInterestRate, years * 12) Note that monthlyInterestRate = annualRate / 12 2. printFutureValueTable () print the future value table for 30 years.

Design the printing layout as close of the above example, for 30 years.

All the programming style and compiling requirements apply.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!