Answer to Question #181765 in Java | JSP | JSF for sufiyan

Question #181765

Design loan calculator using JSP which accepts Periodof Time (in years) and Principal Loan Amount. Display

the

payment amount for each loan and then list the loan

balance and interest paid for each payment over the

term of the

loan for the following time period and interest rate:

a. 1 to 7 year at 5.35%

b. 8 to 15 year at 5.5%

c. 16 to 30 year at 5.75%


1
Expert's answer
2021-04-16T03:49:15-0400
import java.io.*;
  
public class GFG {
      
    // Function to calculate EMI
    static float emi_calculator(float p, 
                           float r, float t)
    {
        float emi;
      
        r = r / (12 * 100); // one month interest
        t = t * 12; // one month period
        emi = (p * r * (float)Math.pow(1 + r, t)) 
                / (float)(Math.pow(1 + r, t) - 1);
      
        return (emi);
    }
      
    // Driver Program
    static public void main (String[] args)
    {
          
        float principal, rate, time, emi;
        principal = 10000;
        rate = 10;
        time = 2;
          
        emi = emi_calculator(principal, rate, time);
          
        System.out.println("Monthly EMI is = " + emi);
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog