我有一個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