PackageCom.xiaowu.demo;/*** Bonuses awarded by the enterprise are subject to profit (I) less than or equal to $100,000, bonuses may be raised by 10%, profit above $100,000, less than $200,000, under 100,000 commission, * higher than 10% yuan, 100,000, 7.5% to 200,000 Higher than 200,000 yuan, can be 5%, 400,000 to 600,000, higher than 400,000 yuan of the portion, can be a commission of 3%, * 600,000 to 1 million, higher than 600,000 yuan of the portion, can be a commission of 1.5%, higher than 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? * * @authorWQ **/ Public classDemo13 { Public Static voidMain (string[] args) {Money (1000); } Public Static voidMoneyDoublex) {Doubley = 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 + * 0.075 + (x-20) * 0.05; } Else if(x > <= && 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) {y= * 0.175 + + * 0.08 + + * 0.015 + (x-100) * 0.01; } System.out.println ("Profit is:" + x + "million. \ nthe bonus should be extracted as: "+ y +" million. "); }}
Java Common algorithm questions (13)