Write a program that reads in investment amount annual inter

Write a program that reads in investment amount, annual interest rate, and number of years, and displays the future investment value using the following formula:


For example, if you enter amount 1000 , annual interest rate 3.25% , and number
of years 1 , the future investment value is 1032.98 .

I need the inputs, outputs, flowchart, and pseudocode. This is for Java.

future Investment Value investment Amount x monthly InterestRate)numberoneas 12

Solution

FutureInvestmentCalc.java

import java.text.DecimalFormat;
import java.util.Scanner;

public class FutureInvestmentCalc {

   public static void main(String[] args) {

       //Creating the DecimalFormat class object
       DecimalFormat df=new DecimalFormat(\"#.##\");
      
       //Scanner Object is used to get the inputs entered by the user
       Scanner sc=new Scanner(System.in);
         
       double investment_amount,annual_interest_rate,future_investment;;
       int no_of_years;
      
       System.out.print(\"Enter the investment amount :\");
       investment_amount=sc.nextDouble();
      
       System.out.print(\"Enter the Annual Interst Rate :\");
       annual_interest_rate=sc.nextDouble();
  
       System.out.print(\"Enter No of years :\");
       no_of_years=sc.nextInt();
      

       //calculating the future investment
       future_investment = (investment_amount )* Math.pow(1 + (annual_interest_rate/1200),no_of_years*12);

       //Displaying the future investment value
       System.out.println(\"Future Investment value is \"+df.format(future_investment));
      

   }

}

______________________

Output:

Enter the investment amount :1000
Enter the Annual Interst Rate :3.25
Enter No of years :1
Future Investment value is 1032.99

__________Thank You

Write a program that reads in investment amount, annual interest rate, and number of years, and displays the future investment value using the following formula

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site