JSP Loan Calculator


<%!double interest=0.0;%>

<%

double amount=Double.parseDouble(request.getParameter(“t1”));

int year=Integer.parseInt(request.getParameter(“t2”));

if(year >=1 || year <=7)

{

interest=(amount*5.35)/100;

out.println(“Interest =”+interest);
}else if(year>=8 || year <=15)

{

interest=(amount*5.5)/100;

out.println(“Interest =”+interest);

}

else if(year>=16||year<=30)
{

interest=(amount*5.75)/100;

out.println(“Interest =”+interest);

}else{out.println(“Year invalid…”);
}

%>