CSCI 107 Assignment 5
- Due Date: Friday, October 14th no later than 11:59 p.m.
- Partner Information: You may complete this assignment individually or
with exactly one classmate.
- Submission Instructions (working alone): Upload your solution,
entitled YourFirstName-YourLastName-Assignment5.py
to the BrightSpace Assignment 5 Dropbox.
- Submission Instructions (working with exactly one classmate): Upload your solution, entitled
YourFirstName-YourLastName-PartnerFirstName-PartnerLastName-Assignment5.py
to the BrightSpace Assignment 5 Dropbox. Note: If you work with a
partner, only one person should submit a solution. If you both
submit a solution, the submission that will be graded is the one from
the partner whose last name comes alphabetically first.
- Deadline Reminder: Once the submission deadline passes, BrightSpace
will no longer accept your submission and you will no longer be able
to earn credit. Thus, if you are not able to fully complete the
assignment, submit whatever you have before the deadline so that
partial credit can be earned.
Learning Outcomes
- Gain experience writing a Python function.
- Gain experience writing Python selection statements.
Assignment
- Download tax.py and rename
it according to the instructions above.
- Modify the program by adding the missing function. The
missing function will use Python selection statements
to calculate the amount of tax that a single (unmarried)
taxpayer owes using the table below. If the missing function
is implemented correctly, this output
will appear.
Note: the federal tax is progressive. For example, if a person has
a taxable income of $15,000, the first $9,950 is taxed at a rate of 10% and
the remaining $5,050 is taxed at a rate of 12%.
Single Filer Rate |
Taxable Income Bracket |
10% |
$0 - $9,950 |
12% |
$9,951 - $40,525 |
22% |
$40,526 - $86,375 |
24% |
$86,376 - $164,925 |
32% |
$164,926 - $209,425 |
35% |
$209,426 - $523,600 |
37% |
$523,601 or more |
Grading - 100 points
- 49 points - Your program calculates the income tax for each
of seven test cases
correctly (7 points each). Note: these
test cases will be different than the ones in the provided code,
so make sure that your solution is a general one.
- 30 points - A function with the correct name (10 points), correct
parameters (10 points) and correct return value (10 points) is
used in the solution.
- 10 points - An appropriate function comment appears above the
function that you write.
- 11 points - The output format of the output transcript is
matched exactly.