I have a text box(having name b) and one submit button in index.jsp. I will enter something in text box then after clicking submit i get that value by in server side find.jsp. In find.jsp i get the value by request.getParameter("b"); In find.jsp calaculation is done as shown below:
double c=0;
double d=0;
7800.0/12 and 2640.0/12 are fixed.
if request.getParameter("b")=1 then
c=7800.0/12*5;// 5 is multiplied with above number(in first one)
d=2640.0/12*5;// 5 is multiplied with above number(in second one)
if request.getParameter("b")=2 then
c=7800.0/12*8;// here 5 gets incremented by 3 and became 8(in first one)
d=2640.0/12*8;// same also here( in second one)
Similarly if i will enter 20 then accordingly c and d will be calculated.
I cannot use if-else as any value can be entered in client side and accordingly c and d will be calculated in server side.
How can i implement it in a loop? Many thanks
try