The enterprise grants the bonus according to the profit commission, enters the month profit I from the keyboard, asks should the bonus sum be issued?

Source: Internet
Author: User

Title: The bonuses awarded by the Enterprise are based on the profit commission. Profit(I)less than or equal toTenmillion, bonuses can be raised10%; profit is higher thanTenmillion dollars, below -million when the lowerTenthe million part press10%Commission, higher thanTenmillion part of the Cocoa Commission7.5%; -million to +between million, above -million part, can be a commission5%; +million to -between million and above +million part, can be a commission3%; -million to -between million, above -million part, can be a commission1.5%, higher than -million when the more than -the million part press1%Commission, enter the month profit from the keyboardI, should the total bonus be paid?

Program Analysis: Please use the axis to demarcation, positioning.

Program Source code:

#define _crt_secure_no_warnings

#include <stdio.h>

#include <stdlib.h>


int main ()

{

Double i=0;

Double Bonus1, Bonus2, BONUS4, BONUS6, BONUS10, bonus;//bonus means bonus

printf ("Please enter monthly profit:");

scanf ("%d", &i);

BONUS1 = 100000 * 0.1; Bonus2 = Bonus1 + 100000 * 0.75;

BONUS4 = bonus2 + 200000 * 0.5;

BONUS6 = BONUS4 + 200000 * 0.3;

BONUS10 = BONUS6 + 400000 * 0.15;

if (I <= 100000)

{

Bonus = i*0.1;

}

else if (I <= 200000)

{

Bonus = Bonus1 + (i-100000) *0.075;

}

else if (i <= 400000)

{

Bonus = Bonus2 + (i-200000) *0.05;

}

else if (i <= 600000)

{

Bonus = BONUS4 + (i-400000) *0.03;

}

else if (i <= 1000000)

{

Bonus = BONUS6 + (i-600000) *0.015;

}

Else

{

Bonus = Bonus10 + (i-1000000) *0.01;

}

printf ("Total bonus payable: bonus=%ld\n", bonus);

System ("pause");

return 0;

}


Operation Result:

Please enter monthly profit:1000000

Total Prizes payable:bonus=100000

Please press any key to continue ...


This article is from the "Rock Owl" blog, please be sure to keep this source http://yaoyaolx.blog.51cto.com/10732111/1765902

The enterprise grants the bonus according to the profit commission, enters the month profit I from the keyboard, asks should the bonus sum be issued?

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.