The program is a Java code to calculate the monthly EMI (Equated Monthly Installment) based on the principal amount, rate of interest, and time in years entered by the user.
Here are the steps performed in the program:
The formula used to calculate EMI is based on the compound interest formula, and it takes into account the principal amount, rate of interest, and time period to calculate the monthly installment to be paid by the borrower. The formula assumes a constant rate of interest and a constant monthly installment over the entire loan period.
import java.util.*; public class EMI { public static void main(String []args) { Scanner input = new Scanner(System.in); double pri, rate, time, emi; System.out.print("Enter the Principal : "); pri = input.nextFloat(); System.out.print("Enter the Rate : "); rate = input.nextFloat(); System.out.print("Enter Time in Year : "); time = input.nextFloat(); rate = rate/(12*100); //one month interest time = time*12; //one month period emi = (pri*rate*Math.pow(1+rate,time))/(Math.pow(1+rate,time)-1); System.out.print("Monthly EMI is : "+emi+"\n"); } }
Enter the Principal : 50000 Enter the Rate : 5.0 Enter Time in Year : 12 Monthly EMI is : 462.4452067849273
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions