$30
CS 100 Project Two
Project Overview: In this project, you will use your knowledge of selection and iteration to write a program to help
tax payers to figure out their 2018 estimated taxes. The program will ask the user for the filing status and estimated
taxable income, and then compute and print the estimated taxes using the tax rate schedules as shown below. (The
line 3 mentioned in the tax rate schedules below is the estimated taxable income.)
The program will first prompt the user to enter an integer (1 through 5) that represents their filing status as shown
below. If the user enters an invalid filing status, the program will print out an error message and ask for the filing
status again. The program will keep asking the same question until the user enters a valid filing status.
1. Single
2. Married filing jointly
3. Married filing separately
4. Head of household
5. Qualifying widow(er)
The program will then prompt for their estimated taxable income (a real number). If the user enters a negative value,
the program will print out an error message and change the income to be 0 (zero).
Based on the filing status and the taxable income, the program will compute and print the estimated tax. Please make
sure that each output value be properly labeled and formatted. Otherwise you may not receive credit. For the tax
amount in this project, you need to limit it two decimal places.
The program shall handle multiple tax payers. Once the program finishes with computing the tax for the first tax
payer, it will ask for filing status and taxable income of the second tax payer. The process continues until the user
enters 0 as the filing status. At that point, the program will say goodbye and terminate. A sample execution of the
program is shown at the end of this document, with the program prompts/output in red and the user input in blue.
You need to test your program with every filing status and every tax bracket. To verify whether your program works
correctly with a test case, you can post the test case and its result to Piazza and ask whether others agree with your
result. However, posting any part of C code from the project on Piazza is prohibited.
What You Need To Do
• Create a directory named project2 on your machine. In that directory, create a file named tax.c
• In tax.c, write the code needed to solve the problem stated above. Make sure that your program has a
header block of comments that includes your name and a brief overview of the program.
• When you are ready to submit your project, compress your project2 directory into a single (compressed)
zip file, project2.zip. See the Basics document on Blackboard if you don’t remember how to do it.
• Once you have a compressed zip file named project2.zip, submit that file to Blackboard.
A sample execution of the program
Enter 1-5 for filing status or 0 to quit
1. Single
2. Married filing jointly
3. Married filing separately
4. Head of household
5. Qualifying widow(er)
0. Quit
What is your choice? 100
Invalid choice entered.
Enter 1-5 for filing status or 0 to quit
1. Single
2. Married filing jointly
3. Married filing separately
4. Head of household
5. Qualifying widow(er)
0. Quit
What is your choice? 1
Enter your estimated taxable income: -1000
No negative income. It is reset to 0 (zero)
Your estimated tax is 0.00
Enter 1-5 for filing status or 0 to quit
1. Single
2. Married filing jointly
3. Married filing separately
4. Head of household
5. Qualifying widow(er)
0. Quit
What is your choice? 1
Enter your estimated taxable income: 55000
Your estimated tax is 8039.50
Enter 1-5 for filing status or 0 to quit
1. Single
2. Married filing jointly
3. Married filing separately
4. Head of household
5. Qualifying widow(er)
0. Quit
What is your choice? 2
Enter your estimated taxable income: 55000
Your estimated tax is 6219.00
Enter 1-5 for filing status or 0 to quit
1. Single
2. Married filing jointly
3. Married filing separately
4. Head of household
5. Qualifying widow(er)
0. Quit
What is your choice? 0
Goodbye.