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

using pseudocode for this program is: input the investment amount input the annu

ID: 3887742 • Letter: U

Question


using pseudocode for this program is:
input the investment amount
input the annual interest rate
input the number of years
concert annual interest rate to decimal value
compute the monthly interest rate
compute the total number of months of the investment
compute future investment value
output the future investment value

Financial application: calculate future investment value) Write a reads in an investment amount, the annual interest rate, and the n and displays the future investment value using the following formula: 60 Chapter 2 Elementary Programming number of year *2.19 (Financial application Ent Af ent × (1 + monthlyInterestRate)numberOjMonth, tereInvesmienrValue = investmentArno 000, an annual interest rate of 4 2.22 For example, if you enter the amount 1 IS and the number of years as l, the future investment value is 1043.3. sample run: Enter investment amount: 1000 Enter Enter annual interest rate: 4.25 pentr Enter number of years: 1 Er Accumulated value is 1043.33 Sect 2.2 2.

Explanation / Answer

package com.demo;

import java.util.Scanner;

public class ElementaryProgramming {

public static void main(String[] args) {

Scanner scanner = new Scanner(System.in);

System.out.println("enter investment amount");

double investmentAmount = scanner.nextDouble();

System.out.println("enter annual interest rate ");

double annualInterestRate = scanner.nextDouble();

double monthlyInterestRate = annualInterestRate / 12;

System.out.println(monthlyInterestRate);

double roundoff = Math.round(monthlyInterestRate * 100.0) / 100.0;

System.out.println(roundoff);

System.out.println("enter no of years");

int noofyears = scanner.nextInt();

int noofmonths = noofyears * 12;

System.out.println(noofmonths);

double value = Math.pow(1 + roundoff, noofmonths);

double roundoff1 = Math.round(value * 100.0) / 100.0;

System.out.println("roundoff" + roundoff1);

double futureInvestmentValue = investmentAmount * roundoff1;

System.out.println("future" + futureInvestmentValue);

}

}