计算企业应发放奖金总数,奖金发放标准如下:\n\n企业发放的奖金根据利润进行提成,利润低于或等于10万元时,奖金可提10%;利润高于10万元,低于20万元时,低于10万元的部分按10%提成,高于10万元的
时间: 2023-05-01 15:07:13 浏览: 132
这道题目让你计算企业应该发放的总奖金,并附上发放奖金的标准。企业发放的奖金根据利润进行提成,当利润低于或等于10万元时,奖金可提取10%;利润高于10万元,低于或等于20万元时,超出10万元部分的奖金可提取10%,利润高于20万元时,超出20万元部分的奖金则可提取5%。
相关问题
企业发放的奖金根据利润提成: 利润低于或等于10万元的部分,奖金可提成 10%; 利润高于10万元,低于或等于20万元的部分可提成7.5%; 利润高于20万元,低于或等于40万元的部分可提成5%; 利润高于40万元,低于或等于60万元的部分可提成3%; 利润高于60万元,低于或等于100万元的部分可提成1.5%; 利润高于100万元的部分可提成1%。 如果利润小于或等于0,则提成为0。 输入利润,求应发放奖金总数。 利润值,float64类型。 奖金数,固定保留2位小数。
你可以使用以下的 C 代码来解决这个问题:
```c
#include <stdio.h>
double calculateBonus(double profit) {
double bonus = 0.0;
if (profit > 0 && profit <= 10) {
bonus = profit * 0.1;
} else if (profit > 10 && profit <= 20) {
bonus = 10 * 0.1 + (profit - 10) * 0.075;
} else if (profit > 20 && profit <= 40) {
bonus = 10 * 0.1 + 10 * 0.075 + (profit - 20) * 0.05;
} else if (profit > 40 && profit <= 60) {
bonus = 10 * 0.1 + 10 * 0.075 + 20 * 0.05 + (profit - 40) * 0.03;
} else if (profit > 60 && profit <= 100) {
bonus = 10 * 0.1 + 10 * 0.075 + 20 * 0.05 + 20 * 0.03 + (profit - 60) * 0.015;
} else if (profit > 100) {
bonus = 10 * 0.1 + 10 * 0.075 + 20 * 0.05 + 20 * 0.03 + 40 * 0.015 + (profit - 100) * 0.01;
}
return bonus;
}
int main() {
double profit;
printf("请输入利润:");
scanf("%lf", &profit);
double bonus = calculateBonus(profit);
printf("应发放奖金总数为:%.2lf\n", bonus);
return 0;
}
```
你可以在输入利润后,程序将计算并输出应发放的奖金总数。保留两位小数。
描述 企业发放的奖金根据利润提成: 利润低于或等于10万元的部分,奖金可提成 10%; 利润高于10万元,低于或等于20万元的部分可提成7.5%; 利润高于20万元,低于或等于40万元的部分可提成5%; 利润高于40万元,低于或等于60万元的部分可提成3%; 利润高于60万元,低于或等于100万元的部分可提成1.5%; 利润高于100万元的部分可提成1%。 如果利润小于或等于0,则提成为0。 输入利润,求应发放奖金总数。 输入描述 利润值,float64类型。 输出描述 奖金数,固定保留2位小数。使用C语言实现
以下是使用C语言实现的代码:
```c
#include <stdio.h>
int main() {
double profit, bonus;
scanf("%lf", &profit);
if (profit <= 0) {
bonus = 0;
} else if (profit <= 100000) {
bonus = profit * 0.1;
} else if (profit <= 200000) {
bonus = 100000 * 0.1 + (profit - 100000) * 0.075;
} else if (profit <= 400000) {
bonus = 100000 * 0.1 + 100000 * 0.075 + (profit - 200000) * 0.05;
} else if (profit <= 600000) {
bonus = 100000 * 0.1 + 100000 * 0.075 + 200000 * 0.05 + (profit - 400000) * 0.03;
} else if (profit <= 1000000) {
bonus = 100000 * 0.1 + 100000 * 0.075 + 200000 * 0.05 + 200000 * 0.03 + (profit - 600000) * 0.015;
} else {
bonus = 100000 * 0.1 + 100000 * 0.075 + 200000 * 0.05 + 200000 * 0.03 + 400000 * 0.015 + (profit - 1000000) * 0.01;
}
printf("%.2lf\n", bonus);
return 0;
}
```
输入利润值,程序会根据利润值计算出应发放的奖金总数,并输出。
阅读全文
相关推荐















