Calculate Monthly Income

Source: Internet
Author: User

/* *copyright (c) 2016, College of Computer and Control engineering, Yantai University *all rights reserved * File name: 123.cpp * Author: Zong Tao * Completion date: March 13, 2016 * version number: v1.0 * * Problem Description: Write Select the structure program, enter the total monthly income of the individual, calculate its tax payable this month and after-tax income. * Input Description: An integer representing the total monthly income of the individual. * Program output: Two numbers, the sub-table represents this month's tax payable and after-tax income.    */#include <iostream>using namespace Std;int main () {int t;    Double dsalary,dtax=0,dnetincome=0;    cout<< "Please enter your total revenue for this month (yuan):";    cin>>dsalary;    t=dsalary-3500;    if (t<=0) {dtax=t;    } else 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<< "You should pay personal income tax this month <<dTax<<" yuan, after-tax income is "<<dNetIncome<<" Yuan.    \ n "; cout<< "pay taxes according to law and share prosperity." Thanks for using!    \ n "; return 0;}
Operation Result:



Calculate Monthly Income

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.