You are to write a C++ program to compute federal personal income taxes. The tax
ID: 3647628 • Letter: Y
Question
You are to write a C++ program to compute federal personal income taxes. The tax owned 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. <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?>
Tax Rate
Single Filers
Married Filing Jointly
Married Filing Separately
Head of Household
10%
Up to $7,550
Up to $15,100
Up to $7,550
Up to $10,750
15%
$7,551-$30,650
$15,101-$61,300
$7,551-$30,650
$10,751-$41,050
25%
$30,651-$74,200
$61,301-$123,700
$30,651-$61,850
$41,051-$106,000
28%
$74,201-$154,800
$123,701-$188,450
$61,851-$94,225
$106,001-$171,650
33%
$154,801-$336,550
$188,451-$336,550
$94,226-$168,275
$171,651-$336,550
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%.
Variables
Name
Type
Description and edit specifications
statusCode
int
Status code must be from 1 to 4. 1=single, 2=married filing jointly, 3=married filing separately, 4= head of household, 9 = end processing.
taxableIncome
float
Taxable income is entered by the user from the keyboard. The amount must be numeric and not less than $500.
taxAmt
float
taxAmt is a calculated field and is determined from the supplied tax table as applied to the taxableIncome.
Your program should be modular, that is small blocks of code. (Later in the semester when we encounter functions, you will see how handy modular development can be.) You are to follow these specifications as closely as possible. You should have code blocks that do the following:
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.
Example of calculations and resulting output (note: it is ok to take some liberties with the output format.)
Taxable Income: $70000, Filing status of Married Filing Jointly
Taxable income brackets
Tax rate
Tax amt.
15100
.10
1510.00
(61300
Tax Rate
Single Filers
Married Filing Jointly
Married Filing Separately
Head of Household
10%
Up to $7,550
Up to $15,100
Up to $7,550
Up to $10,750
15%
$7,551-$30,650
$15,101-$61,300
$7,551-$30,650
$10,751-$41,050
25%
$30,651-$74,200
$61,301-$123,700
$30,651-$61,850
$41,051-$106,000
28%
$74,201-$154,800
$123,701-$188,450
$61,851-$94,225
$106,001-$171,650
33%
$154,801-$336,550
$188,451-$336,550
$94,226-$168,275
$171,651-$336,550
35%
$336,551 or more
$336,551 or more
$168,276 or more
$336,551 or more
Explanation / Answer
#include #include #include //library for formating floats using namespace std; int main(){ // Variable declarations and initialiaztion to 0 int statusCode=0; float taxableIncome=0.0, taxAmt=0.0; string filingStatus[4]={"Single Filers","Married Filing Jointly", "Married Filing Separately","Head of Household"};//array of names for statusCode choices while(statusCode!=9){ //******INPUT STATUS CODE***** do{ coutstatusCode; } while(statusCode4)&&(statusCode!=9)));//stays in loop until valid statusCode entered //******INPUT TAXABLE INCOME***** do{ couttaxableIncome; } while(taxableIncomeRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.