Lab Tax & MaxMin
/**0~370,000元 6 % 0元
370,001~990,000元 13% 25,900元
990,001~1,980,000元 21% 105,100元
1,980,001~3,720,000元 30 % 283,300元
>3,720,001元 40% 655,300元
9224205 */
public class LabTaxCalculation {
public static void main(String[] args) {
double income=1000000;
double tax = 0 ;
if (income <370001)
tax = income*0.06+0;
else if (income < 990001)
tax = (income -370000)*0.13+25900 ;
else if (income < 1980001)
tax = (income -990000)*0.21+105110 ;
else if (income < 3720001)
tax = (income-1980000)*0.3 +283300;
else
tax = (income-3720000)*0.4 + 655300;
System.out.print("tax = " + tax ) ;
}
}
--------------------------------------------------
//9224205
package welcome;
import java.io.*;
public class maxMin {
public static void main(String[] args) throws IOException{
BufferedReader keyboard= new BufferedReader(new InputStreamReader(System.in));
System.out.println("the first number is :") ;
String inputNumber1 = keyboard.readLine();
System.out.println("the second number is :") ;
String inputNumber2 = keyboard.readLine();
System.out.println("the third number is :") ;
String inputNumber3 = keyboard.readLine();
System.out.println("the forth number is :") ;
String inputNumber4 = keyboard.readLine();
int number1 = Integer.parseInt(inputNumber1);
int number2 = Integer.parseInt(inputNumber2);
int number3 = Integer.parseInt(inputNumber3);
int number4 = Integer.parseInt(inputNumber4);
int number5 = Integer.parseInt(inputNumber1);
int number6 = Integer.parseInt(inputNumber2);
int number7 = Integer.parseInt(inputNumber3);
int number8 = Integer.parseInt(inputNumber4);
if (number1
if (number1
if (number1
if (number5>number6)
number5=number6;
if (number5>number7)
number5=number7;
if (number5
System.out.println( " the Max "+number1 ) ;
System.out.println( " the Min "+number5 ) ;
}
}
0 Comments:
張貼留言
<< Home