C + + window design Practice Project 2 person Income tax Calculator

Source: Internet
Author: User

2, the preparation of multi-branch selection structure program, enter the total monthly income, calculated his monthly tax and after-tax income.

Income Tax calculation method: from . years 9 Month 1 since the beginning of the day, our country adjusts the personal income tax levy point. The base is raised to 3500 , and the excess is calculated at the following 7 levels.

Serial number

Income Range

Rate

Calculator Deduction Number

1

more than 0 to the

3%

0

2

more than 1500 4500

10%

105

3

more than 4500 9000

20%

555

4

more than 9,000 35,000

25%

Span style= "FONT-SIZE:24PX; Color:black ">1005

5

more than 35,000 55,000

30%

Span style= "FONT-SIZE:24PX; Color:black ">2755

6

more than 55,000 Yuan to 80,000 part of the meta

35%

5505

7

more than 80,000 above

45%

13505

Personal Income Tax calculation method: personal income tax = Taxable Income amount * Tax rate - calculator Deductions, of which: Taxable Income amount = Total revenue - Non-taxable income - Tax Exempt income - each deduction.

tax-exempt income and deductions are ignored, non-taxable income is the starting point base 3500 personal income tax = ( Total revenue -3500) * Tax rate - Calculator deduction number

For example: Wang's total monthly income 3600 yuan, personal income tax = ( 3600-3500 ) *3%=3 Yuan, Li a month income 13500 yuan, personal income tax = ( 13500-3500 ) *25%-1005=2500-1005=1495 Yuan.

The crux of the matter is how to determine the tax rate and calculator deduction based on the amount of taxable income.

To complete the running interface:

Each control is associated with a variable:

Master Run code:

<span style= "FONT-SIZE:24PX;" > void Cmydlg::onbutton1 () {//Todo:add your control notification handler code here    UpdateData ();    Double P;if (m_m<1500)    {        m_n=0;       p=0.03;    }    else if (m_m<4500)    {        m_n=105;        p=0.1;    }    else if (m_m<9000)    {        m_n=555;        p=0.20;    }    else if (m_m<35000)    {        m_n=1005;        p=0.25;    }    else if (m_m<55000)    {        m_n=2755;        p=0.30;    }    else if (m_m<80000)    {        m_n=5505;        p=0.35;    }    else    {        m_n=13505;        p=0.45;    } m_k=m_m* (1-p)-m_n; UpdateData (FALSE);             </span>


Finally understand what is the matter.

C + + window design Practice Project 2 person Income tax Calculator

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.