zoukankan      html  css  js  c++  java
  • 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<<"元。
    ";  
        cout<<"依法纳税,共享繁荣。谢谢使用!
    ";  
        return 0;  
    }  

    运行结果:

      

    心得:

          无

  • 相关阅读:
    centos 部署.NET CORE
    nginx 负载均衡
    graylog centos7 部署
    springboot 2.x centos 7.0 部署
    HashMap源代码阅读理解
    服务器安装redis
    java ---- gradle
    uboot-makefile总览
    makeFile
    Spring 推断构造方法
  • 原文地址:https://www.cnblogs.com/chxuan/p/8232270.html
Copyright © 2011-2022 走看看