我有一个text box(having name b)
,一个在index.jsp
提交按钮。我会再单击submit
我在服务器端find.jsp
获得该值通过后进入文本框的东西。在find.jsp我得到如下所示通过request.getParameter("b");
值。在find.jsp
calaculation完成:通过循环解决的java
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)
类似地,如果我将输入20然后相应c和d将被计算。 如果其他任何值可以在客户端输入,并相应地c和d将在服务器端的计算,我不能使用。 我怎么能实现它在一个循环?非常感谢
请告诉我B和5之间的关系??? – 2012-02-27 06:23:38
没有关系。如果b = 1,那么5将相乘,如果b = 2,则5增加3,所以8将像这样相乘 – Tom 2012-02-27 06:24:46
,并且如果b = 3?什么方程mutipliedNumber = 5 + f(b)?? – 2012-02-27 06:25:48