import java.util.Scanner;
public class Test {
public static void main(String[] args){
int a[]={10000,9000,8000,7000,6000,5000,4000,3000,2000};
double b[]={0.45,0.40,0.35,0.30,0.25,0.20,0.15,0.10,0.05};//所得税率
double result=0.0;
while(true){
System.out.println("please input your income");
Scanner in=new Scanner(System.in);
double income=in.nextDouble();
for(int i=0;i
{result=income*b[i];}
break;
}
System.out.println("个人所得税 result="+result);
}
}
}
import java.io.*;
有七处错误,完整版如下:
public class CalculateTax{
public static void main(String[] args)
{
System.out.println("please input your income");
Scanner in = new Scanner(System.in);
double income = in.nextDouble();
for(int i=0;i
{ result = income*b[i];
break;
}
System.out.println("个人所得税 result="+result);
}
}
}
public static void main(String[] args){ }
应该是:static
在你写完代码的时候,myeclipse或eclipse会自动帮你解析是否符合语法规则,在不符合规则的地方会出现红线。。。
main方法不是这样重写的吧,。。public static void main(String[] args){ }
staic?
应该是
static