CISP 1610 – Programming in C++ Final Examination (Tax Calculation)

CISP 1610 – Programming in C++

Final Examination (Tax Calculation)



You are to modify the midterm examination to take advantages of many of the features that we have encountered in chapters 8 through 12.  The primary objective of the solution remains to compute federal personal income taxes.  The solution can have NO global variables.  The tax liability depends on how much money one makes as well as their filing status.  For our purposes we will use four filing statuses.  These are (1)single filers, (2)married filing jointly, (3)married filing separately, and (4)head of household.


Tax RateSingle FilersMarried Filing JointlyMarried Filing SeparatelyHead of Household
10%Up to $7,550Up to $15,100Up to $7,550Up to $10,750
35%$336,551 or more$336,551 or more$168,276 or more$336,551 or more


For each filing status there are six tax rates.  Each rate is applied to a given amount of the taxable income.  For example, for a taxable income of $450,000 for a single filer, $7,550 is taxed at 10%, ($30,650-$7,550) at 15%, ($74,200-$30,650) at 25%, ($154,800-$74,200) at 28%, ($336,550-$154,800) at 33%, and ($450,000-336,550) at 35%.


The six tax rates are to be stored in a one-dimensional array with data type float.  The four filing status descriptions are to be stored in a one-dimensional array of data type string..




NameTypeDescription and edit specifications
statusCodeintStatus code must be from 1 to 4.  1=single, 2=married filing jointly, 3=married filing separately, 4= head of household, 9 = end processing.
taxableIncomefloatTaxable income is entered by the user from the keyboard.  The amount must be numeric and not less than $500.
taxAmtfloattaxAmt is a calculated field and is determined from the supplied tax table as applied to the taxableIncome.
taxRate[6]float6 tax rates with amounts specified in the above table.
filingStatus[4]string4 filing status descriptions as shown in the above table.




Your program should be modular and contain at least 4 user defined functions beyond the main() function.  You are to follow these specifications as closely as possible.  You should have functions that do the following:



FunctionsDescription and specifications
main()main() should be concise and drive the execution of the solution.  The primary loop should be a while loop that repeats the steps necessary to display the results until the user enters a status code of 9 that will terminate the job.
getStatusCodeThis function is to input the filing status code.  This is to be a return by value function.  You should use a do/while loop to control the input logic.  You are to keep the user in the loop until the input is correct.  You are to ensure that the status codes are as specified above.


getTaxIncomeThis function is to input taxable income and is a return by value function.  You are to use a do/while loop for this logic.  You are to keep the user in the loop until the input is valid.
calcTaxAmtThis function is to calculate the taxAmt as determined by statusCode and taxableIncome.  This is a return by value function.
displayResultsThe role of this function is to display the program’s results.  You are to display the filing status description, the taxable income, and the tax amount.  Your report should use proper formatting.  This is a void function.



Hint:  As you can see the tax rates are the same for each of the filing statuses.  The primary differences in all the status groups are the range amounts for the applicable tax rates. The following is an example of calculations and resulting output with a taxable income of $70,000 and a married filing jointly filing status.  (There is also an Excel spreadsheet supplied that provides details of calculations for each appropriate tax bracket.)  You may experience minor differences between some examples and your program due to computational rounding and truncation.


Taxable Income:  $70000, Filing status of Married Filing Jointly


Display of above

Filing status:  Married Filing Jointly

Taxable income:    $70000.00

Tax amount:          $10615.00

New Download