C++扬帆远航——13(个人所得税计算器)

/*
 * Copyright (c) 2016,烟台大学计算机与控制工程学院
 * All rights reserved.
 * 文件名:shui.cpp
 * 作者:常轩
 * 微信公众号:Worldhello
 * 完成日期:2016年3月6日
 * 版本号:V1.0
 * 问题描述:计算个人所得税和税后工资
 * 程序输入:个人收入
 * 程序输出:见运行结果
 */

#include <iostream>  
using namespace std;  
int main()  
{  
    double dSalary,dTax=0,dNetIncome=0;  
    cout<<"请输入您的本月的收入金额(元):";  
    cin>>dSalary;  
   double t=dSalary-3500;  
    if(t<=1500)  
        dTax=t*0.03;  
    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<<"元。\n";  
    cout<<"依法纳税,共享繁荣。谢谢使用!\n";  
    return 0;  
}  

运行结果:

  

心得:

      无

posted @ 2016-03-23 18:55  壹言  阅读(222)  评论(0编辑  收藏  举报