Graded Problem Set #2.1
IPO Problems
Background
The following programs are formally graded as part of the Unit 2 "Problem Set." You should work on these only as an individual. While working on these problems you may refer to your notes, your textbook, any programs you wrote, and even my videos. However, you should limit your discussion of these programs with classmates. It is acceptable to discuss how you solved a problem in the grand scheme of things, but you should never show your code to a classmate either as the person who is struggling or as the person who is helping a struggling classmate. You can talk ideas, but not specific solutions.
TLDR: these problems should be completed on your own. Unlike the practice problems, where you are allowed, and even encouraged, to talk about the process with your classmates, these should be attempted on your own. If you have difficulty with these, please reach out to me for assistance or guidance.
These problems will be completed using an editor such as Thonny or IDLE and submitted to Autolab for grading.
VIDEO: How to use Thonny and Autolab to submit and test your graded activities.
Activities
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 G1 Percent Off
- IPO G2 BMI
- IPO G3 Paycheck with Overtime
- IPO G4 Passing Wind
IPO G1
Take it off (the price that is)
Lois Price is getting set up for the weekly sales at the store she owns.
Write a Python script that conforms to the following
- Inputs
- Asks for the original price
- Asks for the sale price
- Print Statements
- Prints the percentage off the original price.
- You should round the price to the nearest percentage
- Example(s)
IPO G2
Calculating BMI
Ollie Tenything is trying to lose some weight. He wants help tracking his BMI.
Write a Python script that conforms to the following
- Inputs
- Asks for weight in pounds
- Asks for height in feet
- Asks for remaining height in inches
- Print Statements
- Prints the bmi rounded to two decimal places
- Example(s)
- Special Instructions
- There are a few formulas out there, so please use this one:
- bmi is weight in pounds * 703 divided by height in inches squared.
- There are a few formulas out there, so please use this one:
IPO G3
Paycheck calculator #2
Gladys Friday worked some extra hours this week and she wants some help calculating her expected paycheck. Workers who work over 40 hours a week are supposed to be paid extra pay for the hours above 40 hours that they work. Suppose workers make 1.5x pay rate for each hour they work over 40 hours per week.
Write a Python script that conforms to the following
- Inputs
- Asks for the number of hours worked (let's just assume that this number will always be >=40)
- Asks for the normal, hourly salary
- Print Statements
- Prints the the user's gross pay for the week based on the time-and-a-half rule outlined above.
- Example(s)
- Special Instructions
- This is money, so you should round the price to two decimal places
- Note that this function will not add decimals if fewer than two are used in the answer
IPO G4
Passing Wind
Wendy Windblows is an engineer that builds the turbines you see all over Iowa. She always tells people that the tip of a wind generator blade moves at over 175 MPH. But, people don't actually believe her.
Write a Python script that conforms to the following
- Inputs
- Asks for the RPM (revolutions per minute) of the turbine blades
- Asks for the length of one blade (assumed in feet)
- Print Statements
- Prints the speed (in MPH) of the blade top
- You should round the speed to one decimal place
- Example(s)
- Special Instructions
- Think about the geometry of this problem. The tip of the blade travels the circumference of a circle. This is how far it travels in one rotation. Calculate that first based on the information provided
- Once you do that you can calculate how far it travels in one minute (using RPM).
- At that point, it is a unit conversion problem since you have feet per minute but we want miles per hour.
- When doing unit conversions (feet to miles, minutes to hours, etc) please use the table of conversions found on the homepage of your course website so that all students get the "same" results.
- For sake of this activity set pi to
- Think about the geometry of this problem. The tip of the blade travels the circumference of a circle. This is how far it travels in one rotation. Calculate that first based on the information provided