Java basics 17 and java basics 17

Source: Internet
Author: User

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 );}}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.