标题:新人求助!个人所得税计算
只看楼主
zuiaiafs
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2015-4-28
 问题点数:0 回复次数:2 
新人求助!个人所得税计算
这是我的代码 不知道哪里错了 还是都错了 请大神帮忙
index.jsp
<%@ page pageEncoding="GB2312"%>
<html>
 <body>
  <form action="treat1.jsp" method="post">
 收入<input type="text" name="inCome"/>
 <input type="submit" value="提交"/>
</form>
</body>
</html>
treat1.jsp
<%@ page pageEncoding="GB2312"%>
<html>
<head>
</head>
<body>
 <%
   double come= Double.parseDouble(request.getParameter("inCome"));
   double sr= Double.parseDouble(request.getParameter("shouru"));
%>
<jsp:useBean id="CalculatorBeans" scope="page" class="com.wy.Calculator" />
<jsp:setProperty name="CalculatorBeans" property="inCome" value="<%=come%>" />
<jsp:setProperty name="CalculatorBeans" property="shouru" value="<%=sr%>" />
<jsp:getProperty name="CalculatorBeans" property="shouru" />
<jsp:getProperty name="CalculatorBeans" property="inCome" />
</body>
</html>
Calculator.java
package com.wy;
public class Calculator{
 private double inCome;
 private double shouru;
public void setInCome(Double inCome){
  this.inCome=inCome;
}
public void setshouru(Double shouru){
this.shouru=shouru;
}
public double getInCome(){
  return inCome;
}
public double getshouru(){
return shouru;
}

public double calculate(){
 if(inCome <= 1500){            
           return this.shouru=inCome;
        }
else if(1500 < inCome && inCome< 3000){  
          return this.shouru=inCome*0.95;  
        }
if(3000 <= inCome){  
           return this.shouru=(inCome-(inCome)*0.1+300);
        }  
return 0;
}
}
搜索更多相关主题的帖子: double action method 所得税 
2015-04-28 13:03
zuiaiafs
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2015-4-28
得分:0 
2015-04-28 13:04
zuiaiafs
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2015-4-28
得分:0 
2015-04-28 13:04



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-444595-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.728670 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved