C语言计算佣金
来源:互联网 发布:tensorflow官网 编辑:程序博客网 时间:2024/04/29 23:18
#include<stdio.h>
int main(void)
{
int shares;
float price,value,commission,rival_commission;
printf("Enter number of shares:");
setvbuf(stdout,NULL,_IONBF,0);
scanf("%d",&shares);
printf("Enter price per share:");
scanf("%f",&price);
value =shares*price;
if(value<2500.00f)
commission=30.00f+.007f*value;
else if (value<6250.00f)
commission=56.00f+.0066f*value;
else if (value <20000.00f)
commission=76.00f+.0024f*value;
else if(value<50000.00f)
commission=100.00f+.0022f*value;
else if(value<50000.00f)
commission=155.00f+.0011f*value;
else
commission=255.00f+.0009f*value;
if(commission<39.00f)
commission=39.00f;
rival_commission=33.00f+(shares<2000?.03f:.02f);
printf("The first broker's commission :$%.2f\n",commission);
printf("The second broker's commission:$%.2f\n",rival_commission);
if(commission<rival_commission)
{
printf("The first broker is the right one.\n");
}
else{
printf("The second broker irus the right one.\n");
}
return 0;
}
int main(void)
{
int shares;
float price,value,commission,rival_commission;
printf("Enter number of shares:");
setvbuf(stdout,NULL,_IONBF,0);
scanf("%d",&shares);
printf("Enter price per share:");
scanf("%f",&price);
value =shares*price;
if(value<2500.00f)
commission=30.00f+.007f*value;
else if (value<6250.00f)
commission=56.00f+.0066f*value;
else if (value <20000.00f)
commission=76.00f+.0024f*value;
else if(value<50000.00f)
commission=100.00f+.0022f*value;
else if(value<50000.00f)
commission=155.00f+.0011f*value;
else
commission=255.00f+.0009f*value;
if(commission<39.00f)
commission=39.00f;
rival_commission=33.00f+(shares<2000?.03f:.02f);
printf("The first broker's commission :$%.2f\n",commission);
printf("The second broker's commission:$%.2f\n",rival_commission);
if(commission<rival_commission)
{
printf("The first broker is the right one.\n");
}
else{
printf("The second broker irus the right one.\n");
}
return 0;
}
0 0
- C语言计算佣金
- 股票计算 ,佣金率
- C语言计算100!
- C语言计算随机数
- C语言 日期计算
- C语言计算最大公约数
- C语言计算文件大小
- C语言计算 最大公约数
- C语言计算sinx
- c语言计算文件大小
- C语言 乘法计算
- c语言 计算闰年
- C语言-工资计算
- 淘客到底是什么及佣金的详细计算细则
- 用户推广计划的规则及佣金计算
- C语言计算字符个数
- C语言实现指数计算
- C语言计算字符个数
- java 反射
- ArrayList
- cas相关问题
- 字符数组
- RBAC权限管理
- C语言计算佣金
- Struts2的工作原理
- 『论文阅读』Image-to-Image Translation with Conditional Adversarial Networks
- yvklqxnbtubjusz
- MySQL创建自定义函数时 Error Code: 1418 的解决方法
- 归并排序实现(python)
- mybatis invalid bound statement (not found) 当心文件确实不存在
- web开发
- 集合详解(二)--Set集合