Uploaded by Abdul REhman

Assignment02A - Student Version

advertisement
Assignment
Grade: 3%
Submission: Source codes (i.e., py files) and screen capture of the result.
•
The US federal personal income tax is calculated based on the filing status and taxable income.
There are four filing statuses: single filers, married filing jointly, married filing separately, and
head of household. The tax rates for 2020 are shown below.
Marginal Tax Rate
Single
10%
$0 – $8,350
$8,351–
$33,950
$33,951 –
$82,250
$82,251 –
$171,550
$171,551 –
$372,950
$372,951+
15%
25%
28%
33%
35%
Married Filing
Jointly or
Qualified
Widow(er)
$0 – $16,700
$16,701 –
$67,900
$67,901 –
$137,050
$137,051 –
$208,850
$208,851 –
$372,950
$372,951+
Married Filing
Separately
Head of
Household
$0 – $8,350
$8,351 –
$33,950
$33,951 –
$68,525
$68,525 –
$104,425
$104,426 –
$186,475
$186,476+
$0 – $11,950
$11,951 –
$45,500
$45,501 –
$117,450
$117,451 –
$190,200
$190,201 $372,950
$372,951+
Write Python program to compute taxes for the following status:
• Compute tax for single filers – required for the assignment.
• Compute tax for married filing jointly – optional Bonus marks
• Compute tax for married filing separately – optional Bonus marks
• Compute tax for head of household – optional Bonus marks
• Display wrong status.
•
Write a program that randomly generates a lottery between 0 and 99, prompts the user to enter
a number in the same range, and determines whether the user wins according to the following
rule:
• If the user input matches the lottery in exact order, the award is $10,000.
• If the user input matches the lottery, the award is $3,000.
• If one digit in the user input matches a digit in the lottery, the award is $1,000.
•
Write a program to find out the Chinese Zodiac sign for a given year. The Chinese Zodiac sign is
based on a 12-year cycle, each year being represented by an animal: rat, ox, tiger, rabbit,
dragon, snake, horse, sheep, monkey, rooster, dog, and pig, in this cycle.
Use only case Statement. No other format of if statements
Material has been taken from (can be accessed through Sheridan's Library Services) :
• Starting Out with Python (ISBN-13: 9780136912330 ):
•
•
•
https://www.pearson.com/en-ca/subject-catalog/p/starting-out-withpython/P200000003356/9780136912330
Introduction to programming using PYTHON, Y. Daniel Liang, Armstrong Atlantic State University
https://www.pearson.com/en-us/subject-catalog/p/introduction-to-programming-usingpython/P200000003454/9780137521272
Murach’s Python 2nd Edition programming, 2nd Edition :
https://bookshelf.vitalsource.com/reader/books/9781943872756/pages/recent
Introducing Python, Lubanovic, B., O'Reily Media, 2nd Edition, 2019
https://www.oreilly.com/library/view/introducing-python-2nd/9781492051374/
Download