C++作业3
来源:互联网 发布:淘宝联盟的钱怎么提现 编辑:程序博客网 时间:2024/04/29 23:09
项目1:个人所得税计算器
#include <iostream> using namespace std;int main( ){double dSalary,dTax=0,dNetIncome=0,dValue; cout<<"请输入您本月的收入总额(元):";cin>>dSalary;// 下面求解应缴个人所和税dTax和税后收入dNetIncomedValue=dSalary-3500;if(dValue<=0) dTax=0.0; else if(0<dValue&&dValue<=1500) dTax=dValue*0.03-0.0;else if(dValue<=4500)dTax=dValue*0.10-105.0;else if(dValue<=9000)dTax=dValue*0.20-555.0;else if(dValue<=35000)dTax=dValue*0.25-1005.0;else if(dValue<=55000)dTax=dValue*0.30-2755.0;else if(dValue<=80000)dTax=dValue*0.35-5505.0;else if(dValue>80000)dTax=dValue*0.45-13505.0; dNetIncome=dSalary-dTax;cout<<"您本月应缴个人所和税 "<<dTax<<" 元,税后收入是 "<<dNetIncome<<" 元。\n";cout<<"依法纳税,共享繁荣。谢谢使用!\n"; return 0;}
项目3:定期存款利息计算器
#include <iostream.h> void main(){double money,interest,all;int code;cout<<"欢迎使用利息计算器!"<<endl;cout<<"请输入存款金额:";cin>>money;cout<<"==========存款期限=========="<<endl;cout<<"1. 3个月\n2. 6个月\n3. 一年\n4. 二年\n5. 三年\n6. 五年 "<<endl;cout<<"请输入存款期限的代号:";cin>>code;switch(code){case 1:{interest=money*0.031*0.250;all=interest+money;break;}case 2:{interest=money*0.033*0.5;all=interest+money;break;}case 3:{interest=money*0.035*1;all=interest+money;break;}case 4:{interest=money*0.044*2;all=interest+money;break;}case 5:{interest=money*0.05*3;all=interest+money;break;}case 6:{interest=money*0.055*5;all=interest+money;break;}}cout<<"到期利息为:"<<interest<<"元,"<<"本息合计共计"<<all<<"元"<<endl;cout<<"感谢您的使用,欢迎下次光临!"<<endl;}
项目4:多分数段函数求值
#include <iostream.h>#include <cmath> void main(){double x,y;cout<<"请输入x的值:";cin>>x;if (x<2) y=x;else if (x<6) y=x*x+1;else if (x<10) y=sqrt(x+1);else if (x>=10) y=1/(x+1);cout<<"y="<<y<<endl;}
0 0
- C++作业3
- C++的作业
- c++作业7
- c语言作业3
- c++-作业3
- c++-作业3
- C/C++作业3
- C语言程序设计课后作业3
- C语言作业(3)
- c 作业
- c作业
- C作业
- c作业
- c作业
- c作业
- c作业
- c作业
- C++P27作业3,4,5,6
- c++作业3多分段函数求值,定期存款利息计算器,本月有几天?
- Linux下使用wget命令下载百度云盘文件
- ACM:POJ-1979 Red And Black(JAVA的字符数组输入以及标记方法)
- 2008
- 利用StegSolve、Python对.jpg文件进行分析
- C++作业3
- 【剑指offer系列】 旋转元素的最小数字___8
- 给Eclipse提速的7个技巧
- 52. N-Queens II
- 分享下android中路径动画svg格式的(一)
- Myeclipse 2014 SVN组件加载失败处理
- Android动态换肤(一、应用内置多套皮肤)
- Codeforces 588C Duff and Weight Lifting 【数学】
- 通过POST方式传递数据给服务器