Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static Double calculateEMI(Long principalAmount, double rateOfInterest, Long downPayment,
            double tenureInMonths) {
        Double emi = (((principalAmount - downPayment) * (rateOfInterest / (12 * 100)))
                * ((Math.pow((1 + (rateOfInterest / (12 * 100))), tenureInMonths))))
                / ((Math.pow((1 + (rateOfInterest / (12 * 100))), tenureInMonths)) - 1);
        return emi;
    }
}