Assignment:
Program 1
Write a program that reads an integer value and prints to the userwhether that value is negative, zero, or positive. Thewording you use to prompt the user for input and give feedback tothe user are up to you, but the instructions should beself-explanatory and the output should be clear. It doesn’thave to be fancy- but it needs to be clear and work!
Program 2 (I suggest you review section2.2 of “Python for Everyone” before you start this program)
Pretend you work at a bank. You want to write a programthat will make change quickly and easily. Write a programthat accepts a dollar value (including 2 decimal places) that isless than $10,000. Assume your bank cashiers have bills inincrements of $20, $10, $5, and $1, and also quarters, dimes,nickles, and pennies. Write a program that tells you how manyof each kind of paper bills and coins to give exact change with theminimum number of bills and coins.
Eg: if I input $19.67 cents, I should get an outputlike:
We suggest the following:
1 - $10 bill
1 - $5 bill
4 - $1 bills
2 – quarters
1 – dime
1 – nickel
2 - pennies
Program 3
Write a program that reads in a string and prints whether it
Contains only letters
Contains only uppercase letters
Contains only lowercase letters
Contains only digits
Contains only letters or digits
Starts with an uppercase letter*
Ends with a period
(Hint- review sections 2.4 and 3.8 of “Python for Everyone”)
*review 2.4 to see how to get the first letter. See 3.8 tosee how to test for uppercase.
Program 4
The original U.S. income tax of 1913 was quite simple. Thetax was:
1% on the first $50,000
2% on the amount over $50,000 up to $75,000
3% on the amount over $75,000 up to $100,000
4% on the amount over $100,000 up to $250,000
5% on the amount over $250,000 up to 500,000
6% on the amount over $500,000
Write a Python program that asks an individual for their income,and then computes the income tax according to thisschedule.
For example:
Please enter your income: 275000.00
The amount of income tax you owe is: 9000.00
Guidelines:
Submission Instructions:
TIPS
I do NOT suggest that you just start trying to hack Pythoncode. I suggest you start with a human level walk-through,then a program-level walk-through, then a flow chart, and thenpseudocode.
Once you have the flow of the program nailed down, THEN convertit to Python code.
Start early- you don’t want to wait until the night before theassignment is due to get started on this homework.
Keep it simple.
Assignment: Program 1 Write a program that reads an integer value and prints to the user whether that value is negative,
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am