第3周项目1—个人所得税计算器(if语句)
2016-03-15 18:43
330 查看
/* *Copyright(c) 2015.烟台大学计算机与控制工程学院 *ALL rights reserved. *文件名称:test.cpp *作者:杨驰 *完成日期:2016年3月15日 *问题描述:编写选择结构程序,输入个人月收入总额,计算出他应缴税款和税后收入。 *问题输入:月收入13500 *问题输出:个人所得税1495元,税后收入12005元 * */ #include<iostream> using namespace std; int main() { double dSalary,dTax=0,dNetIncome=0; cout<<"请输入您本月的收入总额:"; cin>>dSalary; double t=0; t=dSalary-3500; //t=收入总额-3500 if(t<=0) { cout<<"您不需要缴税,您该努力工作了!!!"<<endl; } else { if(t<=1500) dTax=t*0.03-0.0; else if(t<=4500) dTax=t*0.1-105; else if(t<=9000) dTax=t*0.2-555; else if(t<=35000) dTax=t*0.25-1005; else if(t<=55000) dTax=t*0.3-2755; else if(t<=80000) dTax=t*0.35-5505; else dTax=t*0.45-13505; dNetIncome=dSalary-dTax; cout<<"您本月应缴个人所得税"<<dTax<<"元,税后收入是"<<dNetIncome<<"元。"<<endl; } cout<<"谢谢使用!"<<endl; return 0; }
运行结果:
相关文章推荐
- PHP中常量的定义
- shell之dns_zone的配置含义
- Hdu 1051(贪心思想)
- JavaMail创建和发送邮件
- java作业之输入n个学生的m门课程求每个学生的总分和平均分。。。
- 几个基础函数及特性
- Android RecyclerView 使用完全解析
- 《程序员修炼之道》——第二章 注重实效的途径(三)
- yii2.0 的数据的 改
- 安卓第十四天笔记-内容提供者(ContentProvider)
- 经典算法题一览
- JavaScript prototype of object
- (4.5.3.2)android studio编译项目,9 patch图片报错Crunching Cruncher
- 【项目 4:穷举法解决组合问题】
- Java - 动态代理
- 鼠标
- Gradle打jar包,包含所有依赖
- shell定时备份
- USB
- 《LINUX3.0内核源代码分析》第三章:内核同步(1)