為 2,000,000時↓
import java.util.Scanner;
public class work
{
public static void main (String[] args)
{
Scanner keyboard = new Scanner(System.in);
double netIncome, tax;
System.out.println("Enter net income. \n" + "Do not include a dollar sign or commas");
netIncome = keyboard.nextDouble();
if (netIncome <= 370000) tax = 0.06*netIncome; else if (netIncome > 370000 && netIncome <= 990000) tax = 0.13*netIncome-25900; else if (netIncome > 990000 && netIncome <= 1980000) tax = 0.21*netIncome-105100; else if (netIncome > 1980000 && netIncome <= 3720000) tax = (0.3*netIncome-283300); else tax = 0.4*netIncome-655300; System.out.println("Tax of = " + tax); } }
沒有留言:
張貼留言