新人求助!个人所得税计算
这是我的代码 不知道哪里错了 还是都错了 请大神帮忙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;
}
}