Additional Practice Problems
IPO Problems
Activities
These are here as extra practice. They are completely optional.
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 scripts:
- IPO 5 Bob's Burgers goes on Grub Hub
- IPO 6 Making Time
- IPO 7 Calculating an Overall GPA (harder)
- IPO 8 Parking Garage
The Replit documents for each of these problems is located at:
- Replit Code Link - https://replit.com/team/Cohort23
IPO 5
Bob's Burgers goes on Grub Hub
Bob's Burgers has introduced a delivery service.
- You can get the "She's a Super Leek" Burger for $5.95
- You can get the "Pepper Don't Preach" burger for $6.95
- It costs $4.50 to have your food delivered regardless of how much you order
Write a Python script that conforms to the following
- Inputs
- Asks how many Super Leek burgers
- Asks how many Pepper Don't Preach burgers
- Print Statements
- Prints the the total bill.
- Example(s)
- Special Instructions
- You should round the total price to two decimal places
- Note that this function will not add decimals if fewer than two are used in the answer
IPO 6
Making Time
Nick Ovetime is really bad at math. All of the instructions for his job list the time in the total number of minutes. For example, he is supposed to leave the flower pots in the kiln for 590 minutes, but he has no idea what that means in hours and minutes.
Write a Python script that conforms to the following
- Inputs
- Asks for the time in minutes
- Print Statements
- Prints the time in hours and minutes
- Example(s)
- Special Instructions
- There is no need for rounding with this problem since all values will be in integers
IPO 7
Calculating an Overall GPA
Stewart (Stu) Dent works for the Registrar's office at UNI. One of his jobs is updating student records. He is having a hard time working with the overall GPA of transfer students [When students start at one college and finish at another college, a combined GPA must be produced].
Write a Python script that conforms to the following
- Inputs
- Asks for the GPA at college 1
- Asks for the credits earned at college 1
- Asks for the GPA at college 2
- Asks for the credits earned at college 2
- Print Statements
- Prints the the overall, weighted GPA for the student.
- Example(s)
- Special Instructions
- You should round the overall GPA to two decimal places.
- This one is a bit more challenging than some of the others as the math is a bit more involved. There are two ways to think about this:
- GPA is always equal to Grade Points Earned divided by Credits Earned.
- If you earn 54 Grade Points in a semester where you take 16 credits, than your GPA is 54/16 = 3.375 or (3.38 rounded to two decimal places.
- With this technique you have to determine how many grade points the student earned at each college, at them together to find total grade points, and then divide that by the total number of credits earned at the two colleges.
- The GPA at each college is weighted by what percentage of the student's overall credits came from that college.
- If the student earned 16 credits of 2.0 at college 1 and 16 credits of 4.0 at college 2 than each college is 50% of their credits and you add 50% of 2.0 to 50% of 4.0 to get an overall 3.0 GPA
- But, if the student earned 8 credits of 2.0 at college 1 and 24 credit of 4.0 at college 2 than college 1 is only 25% of their credits [and college 2 is 75%]. 25% of 2.0 plus 75% of 4.0 is an overall 3.5 GPA
- GPA is always equal to Grade Points Earned divided by Credits Earned.
IPO 8
Parking Garage
Laurie Park makes payment machines for municipal parking garages.
- Her machines charge for parking in increments of 25 cents.
- Her machines accept payment in quarters and $1, $5, and $10 bills.
- Her machines can only give change in $1 (dollar bills) and $0.25 (quarters)
Write a Python script that conforms to the following
- Inputs
- Asks for the charge for parking (remember, it will be in increments of quarters)
- Asks for the amount of money received from the customer
- Print Statements
- Prints the number of dollar bills and the number of quarters needed to make change.
- Example(s)
- Special Instructions
- Both values calculated are integers and should be treated/displayed as such.