Question: I need the answer in Java format 3. (21 points) Write a method that calculates and returns the value of an investment after a number

I need the answer in Java format  I need the answer in Java format 3. (21 points) Write

3. (21 points) Write a method that calculates and returns the value of an investment after a number of years, assuming that interest is compounded only at the end of each year. Your method will need the following parameters: The initial amount of money invested The interest rate The number of years you will be holding the investment You can use the formula value = investment * (1 + rate)years . You must include a Javadoc comment Name CSCI161-(01,02,03 Homework 03- Page 2 4. (19 points) Write a main method that would go in the same class as the previous method. It should read an initial investment amount and interest rate from the user. Then it should print a two-column table showing the number of years and final value for each year from 1-20. You do not need to include Javadoc comments. You may assume that the Scanner class has already been imported

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!