Menghitung Nilai Investasi Masa Depan

Assalamualaikum, . .
Kali ini saya akan membagikan tentang

import java.util.Scanner;

public class CalculateFutureInvestmentValue {

public static void main(String[] iriahus) {
@SuppressWarnings("resource")
Scanner s = new Scanner(System.in);


System.out.print("Enter investment amount: ");
double invest = s.nextDouble();


System.out.print("Enter annual interest rate in percentage: ");
double iRate = s.nextDouble();


System.out.print("Enter number of years: ");
int year = s.nextInt();


double futureInvestValue = invest * Math.pow(1 + iRate / 1200, year * 12);

System.out.println("Accumulated value is $" + futureInvestValue);
}

}

Semoga bermanfaat, ..

Subscribe to receive free email updates:

0 Response to "Menghitung Nilai Investasi Masa Depan"

Post a Comment