Assignment Set #2
Please try to make your program output look as much like the example as possible and verify it works with the example input provided. If you have difficulty finding the information or understanding how to approach the problem, you should contact me.
To complete this activity, you will need to create the following programs:
- COND_10 wantToRetireNow.py
- COND_11 cellBill.py
- COND_12 whatColor.py
- COND_13 easter.py
COND_10
Create a program named wantToRetireNow.py- Ike Witt is tired of teaching. He wants to know if he can afford to retire.
- To draw IPERS (Iowa Public Employees Retirement System) retirement one must meet one of three conditions:
- sum of age and years of service equals or exceeds 88
- age is at least 62 and years of service is at least 20
- age is 65 or more.
- Provide code that will accept input indicating age and years of service.
- Then report whether a person with these attributes can begin drawing IPERS retirement.
- Here is an example:
- Here is another example:
- Here is another example:
- Here is another example:
COND_11
Create a program named cellBill.py- Fiona Friend is looking at getting a new cell phone carrier.
- A particular cell phone plan includes 60 minutes of air time and 40 text messages for $10.00 a month. Each additional minute of air time costs $0.20 a minute while additional text messages cost $0.10 each. All cell phone bills incluede a charge of $0.72 to support 911 call centers. The entire bill (including the 911 fee) is subject to a 7% sales tax
- Use the money formatting we used earlier and in 8.a
- Here are two examples:
COND_12
Create a program named whatColor.py- Daniel DeRookoh was champion in the 1984 All Valley Chess Tournament. Now he works at "Kobra King" chess consulting services.
- He hires you to help with a simple situation.
- A chess board typically consists of a pattern of white and black squares that look like this:
- Write a program that asks for the row (a number from 1-8) and the column (a letter a-h) and tells the user what color is in that spot.
- Your program can assume that valid inputs are provided. It does not need to do error checking. [For example, I will not test it by using row 9 or column j.
- Here is an example:
- Here is another example:
COND_13
Create a program named easter.py- Holly Day is in charge of scheduling special events at the local nursing home.
- She can never remember when Easter happens.
- It turns out that there is a formula that tells us the date of Easter. For any year from 1900 to 2099 the date (in April or March) is calculated from:
- a=year%19
b=year%4
c=year%7
d=(19*a+24)%30
e=(2*b+4*c+6*d+5)%7
easter = 22 + d + e
- a=year%19
- [NOTE: This looks complicated, but all you have to do is copy this in to your program to use it. You don't need to understand HOW it works.]
- In addition, if the year is 1954, 1981, 2049, or 2076 you have to subtract 7 from that final number.
- This represents the number of days after the end of February. Thus:
- an answer of 1 would mean March 1st
- an answer of 31 would mean March 31st
- an answer of 32 would mean April 1st
- an answer of 61 would mean April 30th [Hint, notice this math/relationship?]
- Write a program that asks the user for a year and prints the date of Easter. If the user enters a year not in our range you should print "That year isn't in range." and do nothing more.
- For example,
-
Testing Your Code
Note - These assignments are not evaluated for a grade. HOWEVER, they are vitally important to the process of learning how to program. I provided these assignments and the autograders so that you can judge whether you are making progress and so that we can focus our in class conversations in the sessions to come. Please make every effort to complete these problems prior to your next class session.
- Go to the AutoLab Homepage for the course
- https://hypnos.cs.uni.edu/courses/CSED1320-F21/assessments
- Log in if necessary
- For each of the assignments listed above, find their submission link under the "Assignment Set" heading
- Upload the corresponding python file for that assignment.
- When the "handin history" page comes up you will need to refresh the page until a score of either 0 or 1 is shown with your assignment.
- Click on the 0/1 score to get feedback.
- Read the information carefully if you received a score of 0 and figure out what you need to do to fix the problem.
- Ask for help from me or other students if you don't understand an error message.
- Resubmit until the program earns a 1.
- Go to the AutoLab Homepage for the course