V22.0002 - ASSIGNMENT 2

Write a program that will compute the tax liability for a resident of the small island nation of Cucamonga.  The local currency is called Prides.

Your program should ask the user for:

  • Income
  • Number of dependents

    Then it must calculate the tax liability for the user.

    Following is a tax table you should use to compute the Cocamongese income tax:

    Annual income Tax Liability (before Dependent Allowance)
    P 0 - P 50,000 tax is 20% of income
    P 50,001 - P 100,000 P 11,000 base plus 25% of income above P 50,000
    P 100,001 - P 250,000 P 28,000 base plus 33% of income above P 100,000
    P 250,001 and up P 75,000 base plus 42% of income above P 250,000

    The Dependent Allowance is an amount deducted from your tax liability for each person who is dependent on you. Following is the Dependent Allowance table:

    Number of dependents Dependent Allowance
    0 P 0
    1 P 2,500
    2 P 4,000
    3 P 5,300
    4 P 6,500
    5 P 7,500

    Note: You cannot have a negative tax liability in Cucamonga.

    It should then output the following:

  • Total Income
  • Tax Liability (before Dependent Allowance)
  • Total Dependent Allowance
  • Net Tax Liability

    Enter your income for the year: 60000
    Enter number of dependents: 2
    P 60000.00Total Income
    P 13500.00Tax Liability (before Dependent Allowance)
    P 4000.00Dependent Allowance
    P 9500.00Net Tax Liability

    You should read integer values from the user.   However, you should output float values.   Alignment of the output values is important.

    You should use if / else if / else statements to choose between the formulae for each tax rate.
    You should use a switch statement to determine the Dependent Allowance.