The bonus paid by the enterprise under the Profit (I) is less than or equal to 100,000 yuan, the bonus can be raised 10%, the profit is higher than 100,000 yuan, below the 200,000 yuan, the part of less than 100,000 yuan by 10% commission, higher than 100,000 yuan portion, the Commission 7.5%, 200,000 to 400,000, higher than 200,000 yuan of the portion, A commission of 5%, 400,000 to 600,000, higher than 400,000 yuan, can be a commission of 3%, 600,000 to 1 million, the portion higher than 600,000 yuan, can be a commission of 1.5%, above 1 million yuan, the portion of more than 1 million yuan by 1% Commission. Enter the current month profit I from the keyboard, the total bonus should be issued?
public class Example12 {
public static void Main (string[] args) {
Money (1000);
}
public static void Money (Double x) {
Double y = 0;
if (x > 0 && x <= 10) {
y = x * 0.1;
} else if (x > Ten && x <= 20) {
y = ten * 0.1 + (x-10) * 0.075;
} else if (x > && x <= 40) {
y = ten * 0.1 + x * 0.075 + (x-20) * 0.05;
} else if (x > I && x <= 60) {
y = ten * 0.1 + * 0.075 + * 0.05 + (x-40) * 0.03;
} else if (x > && x <= 100) {
y = * 0.175 + * 0.05 + * 0.03 + (x-60) * 0.015;
} else if (x > 100) {
}
SYSTEM.OUT.PRINTLN ("Profit is:" +x+ "million Yuan.") \ nthe bonus should be extracted as: "+ y +" million. ");
}
}
Java Classic Programming question 50-way 12