Question

Computing Future Investment Value Problem Description: 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 following formula: 12 futurelnvestmentValue investmentAmountx(1+ monthlylnterestRate) Use the following method header: publie static double futureInvestnentValue double investnentAmount, double monthlyInterestRate, int years) For example, futur Investmentvalue( 1eeee, อ.es/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.8-9%) and prints a table that displays future value for the years from 1 to 30, as shown below: The anount invested: 1800 Annual interest rate: 9% Years Future Value 1093.80 1196.41 29 13467.25 30 14730.57 Coding Instructions 1. Remove all comments generated by NetBeans 2. Your code should run for different values of interest and initial invested amount (i.e. no hard coding values) 3. Write your name near the top of your file and the date of the last revision. 4. Fully document your code with comments. 5. Abide by naming conventions. 6. Indent your code. 7. The class name should be FuturelnvestmentValue

0 0
Add a comment Improve this question Transcribed image text
Answer #1

import java.lang.Math;
import java.util.Scanner;
public class FutureInvestmentValue{

    public static void main(String []args){
        double investment_Amt,interset_Rate;
        Scanner sc = new Scanner(System.in);
        System.out.println("Enter investmentAmount and Interset Rate");
        investment_Amt=sc.nextDouble();
        interset_Rate=sc.nextDouble();
        futureInvestmentValue(investment_Amt, interset_Rate,1);
    }
  
     public static double futureInvestmentValue(double investmentAmount,double monthlyInvestRate,int years){
       
           for(int i=1;i<=30;i++){
            double futureInvestmentValue= investmentAmount*Math.pow((1+monthlyInvestRate),i*12);
          System.out.println("res:"+futureInvestmentValue);
        
           }
        return 0;
    }
}

Add a comment
Know the answer?
Add Answer to:
Computing Future Investment Value Problem Description: Write a method that computes future investment value at a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I need help with this code: Write a program that calculates the future value of an...

    I need help with this code: Write a program that calculates the future value of an investment at a given interest rate for a specified number of years. The formula for the calculation is as follows: futureValue = investmentAmount * (1 + monthlyInterestRate)years*12 Use text fields for interest rate, investment amount, and years. Display the future amount in a text field when the user clicks the Calculate button, as shown in the following figure. It needs to be done in...

  • Please use public class for java. Thank you. 1. (10 points) Write a method that computes...

    Please use public class for java. Thank you. 1. (10 points) 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 futurelnvestmentValue numberOfYears 12 investmentAmount X ( monthlyInterestRate) Use the following method header: public static double futurelnvestmentValue( double investmentAmount, double monthlyInterestRate, 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...

  • Write a program that prints the accumulated value of an initial investment invested at a specified...

    Write a program that prints the accumulated value of an initial investment invested at a specified annual interest and compounded annually for a specified number of years. Annual compounding means that the entire annual interest is added at the end of a year to the invested amount. The new accumulated amount then earns interest, and so forth. If the accumulated amount at the start of a year is acc_amount, then at the end of one year the accumulated amount is:...

  • 1. What is the value of the following investments in the future? (show your work): a)...

    1. What is the value of the following investments in the future? (show your work): a) b) c) d) e) $6,000 invested for 5 years at 16% compounded quarterly?.. $9,000 invested for 7 years at 8% compounded semi-annually? $875 invested for 1 year at 12% compounded monthly?» $22,000 invested for 5 years at 5% compounded annually?» How long will it take to double your investment if the interest rate is 3%?

  • public static void main(String[] args) {         System.out.println("Welcome to the Future Value Calculator\n");         Scanner sc...

    public static void main(String[] args) {         System.out.println("Welcome to the Future Value Calculator\n");         Scanner sc = new Scanner(System.in);         String choice = "y";         while (choice.equalsIgnoreCase("y")) {             // get the input from the user             System.out.println("DATA ENTRY");             double monthlyInvestment = getDoubleWithinRange(sc,                     "Enter monthly investment: ", 0, 1000);             double interestRate = getDoubleWithinRange(sc,                     "Enter yearly interest rate: ", 0, 30);             int years = getIntWithinRange(sc,                     "Enter number of years: ", 0, 100);             System.out.println();            ...

  • What is the future value at the end of year 9 of an investment that starts...

    What is the future value at the end of year 9 of an investment that starts at $3,300 and grows by 8.6% per year for 9 years. ($3,300 is invested at the end of year 1). The interest rate is 10.1% compounded annually

  • Chapter 2 slides 40 to 47 discuss an example program, which computes the future value of...

    Chapter 2 slides 40 to 47 discuss an example program, which computes the future value of an investment given an initial principal and an interest rate. Your task is to modify this program to calculate and print the future values of an investment after 10 years, using several different interest rates.: from 1% to 20%, in increments of 1%. That is, given an initial principal, your program should compute the future value after 10 years given an interest rate of...

  • 169. What is the future value at the end of year 13 of an investment that...

    169. What is the future value at the end of year 13 of an investment that starts at $6,000 and grows by 7% per year for 13 years ($6,000 is invested at the end of year 1). The interest rate is 10% annual compounded annually.

  • Please help me do this program. Add some comments on it. *15.5 (Create an investment-value calculator)...

    Please help me do this program. Add some comments on it. *15.5 (Create an investment-value calculator) Write a program that calculates the future value of an investment at a for the calculation is given interest rate for a specified number of years. The formula investmentAmount * (1monthlyInterestRate ) years *12 futureValue Use text fields for the investment amount, number of years, and annual interest rate. Display the future amount in a text field when the user clicks the Calculate button,...

  • Create a Java file called CompoundInterestYourLastName. Write a method called computeBalance( ) that computes the balance...

    Create a Java file called CompoundInterestYourLastName. Write a method called computeBalance( ) that computes the balance of a bank account with a given initial deposit, annual interest rate, after a given number of years for the investment. Assume interest is compounded yearly. The formula for determining compound interest (compounded yearly) is: A space equals space P space left parenthesis space 1 plus r space right parenthesis space to the power of t space where: A = the future value of...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT