JAVA

星期一, 三月 20, 2006

作業3/13-1稅率

程式碼

package welcome;

/**
*

Title:


*
*

Description:


*
*

Copyright: Copyright (c) 2006


*
*

Company:


*
* @author not attributable
* @version 1.0
*/
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
public class Untitled3 {
public static void main(String[] args)throws IOException {
BufferedReader keyboard=new BufferedReader(new InputStreamReader(System.in));
System.out.println("輸入所得");
String inputIncome=keyboard.readLine();
int netIncome=Integer.parseInt(inputIncome);
double tax;
if(netIncome<=370000)
tax=netIncome*0.06;
else if ((netIncome>370000)&&(netIncome<=990000))
tax=netIncome*0.13-25900;
else if ((netIncome>990000)&&(netIncome<=1980000))
tax=netIncome*0.21-105100;
else if ((netIncome>1980000)&&(netIncome<=3720000))
tax=netIncome*0.3-283300;
else
tax=netIncome*0.4-655300;
System.out.println("Tax due="+tax);
}


}

0 Comments:

发表评论

<< Home