Java basics 17 and java basics 17
Import java. util. Bonus; public class Seventheen {/* the bonus issued by the enterprise is based on the profit. If the profit (I) is less than or equal to 0.1 million yuan, the bonus can be raised by 10%; if the profit is higher than 0.1 million yuan, if the profit is lower than 0.2 million yuan, the portion lower than 0.1 million yuan will be charged by 10%, and the portion higher than 0.1 million yuan, 7.5% for Coco; 0.2 million for a part higher than 0.4 million yuan between 0.2 million and 5%; 0.4 million for a part higher than 0.6 million yuan between 0.4 million and 3%, or for a part higher than yuan; between 0.6 million and 1 million, if the price is higher than 0.6 million yuan, the price can be increased to 1.5%. If the price is higher than 1 million yuan, the price of more than 1 million yuan is increased by 1%, and the current month's profit is input from the keyboard, how many bonuses should be paid? */Public static void main (String [] args) {callback input = new callback (System. in); System. out. println ("Please input the current month profit:"); int a = input. nextInt (); int B, c; c = a; double sum = 0; while (! = 0) {if (a> 100) {B = a-100; sum = sum + B * 0.01; a = 100;} else if (a> 60) {B = A-60; sum = sum + B * 0.015; a = 60;} else if (a> 40) {B = A-40; sum = sum + B * 0.03; a = 40 ;} else if (a> 20) {B = A-20; sum = sum + B * 0.05; a = 20;} else if (a> 10) {B = A-10; sum = sum + B * 0.075; a = 10;} else {sum = sum + a * 0.1; a = 0 ;}} System. out. println (c + ":" + sum );}}