do this code using two classes Emi and main
import java.util.Scanner;
class Emi
{
public static void main(String []args)
{
Scanner a = new Scanner(System.in);
double principal, rate, time, emi;
System.out.print("Enter principal: ");
principal = a.nextFloat();
System.out.print("Enter rate: ");
rate = a.nextFloat();
System.out.print("Enter time in year: ");
time = a.nextFloat();
rate=rate/(12*100);
time=time*12;
emi= (principal*rate*Math.pow(1+rate,time))/(Math.pow(1+rate,time)-1);
System.out.print("Monthly EMI is= "+emi+"\n");
}
}
Extracted text: Da. wite a loan Caleulator progromm that Competer both 0 given loau awovd.auuval Piterest vateI eund total Paymeut for and loan peiod. oimulai- EMI XRx(1+R)N •P Pfuciple Amonit Cloan Require d/sauct icwed) R- Rate ot utereit Per auuum . -for ROT = 8. 75 Theu R - 8. 75/12 /10o 0.00729/666 lepaynial Peiced Total nember of macth, or No -f fustalluents). EMI IPXRX (1+R)"JE/CQ+R)" -17