Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a method that computes future investment value at a given interest rate fo

ID: 3924353 • Letter: W

Question

Write a method that computes future investment value at a given interest rate for a specified number of years. The future investment is determined using the formula in Programming Exercise 2.21. Use the following method header: public static double futurelnvestmentValue C double investmentAmount, double monthlylnterestRate, int years) For example, futureInvestmentValue(10000, 0.05/12, 5) returns 12833.59. Write a test program that prompts the user to enter the investment amount (e.g., 1000) and the interest rate (e.g., 9%) and prints a table that displays future value for the years below:

Explanation / Answer

/**
* @author
*
*/
public class FinancialApplication {

   /**
   * @param Strings
   */
   public static void main(String[] Strings) {

       double futureInvestmentValue = futureInvestmentValue(10000, 0.05 / 12,
               5);

       System.out.print("Accumulated value is $" + futureInvestmentValue);
   }

   /**
   * @param investmentAmount
   * @param monthlyInterestRate
   * @param years
   * @return
   */
   public static double futureInvestmentValue(double investmentAmount,
           double monthlyInterestRate, int years) {
       return investmentAmount
               * Math.pow((1 + monthlyInterestRate), (years * 12));
   }
}

OUTPUT:

Accumulated value is $12833.59

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote