Question: CSC 115 Programming Project 2 The wind makes us colder when it blows across the exposed area of our skin. It draws heat away from
CSC 115 Programming Project 2
The wind makes us colder when it blows across the exposed area of our skin. It draws heat away from out bodies. When the wind speeds up, it draws more heat away, so your body cools faster than if it were a still day. A couple Antarctic explorers in the 40's (Siple and Passel) experimented with water bottles and different wind conditions. They formed the first formula to express windchill. There have been some changes in the formula over the years because windchill is a difficult measurement to express. How many factors should it take into account? the humidity? the person's size and weight? day or night? latitude?
The formulas you need
where velocity is the wind speed in miles per hour and tempF is the Fahrenheit temperature.
The first formula is to calculate the windchill according to an older formula, used up until 2001.
The second formula calculates the windchill according to the current formula.
Your program should develop a table of windchills, based on the user's inputs of the temperature and the starting wind speed. The table should produce columns as seen below, for wind speed, the windchill according to the old formula, windchill according to the new formula and the difference between the two windchills. The table should be nicely labeled; the use of tab characters is encouraged. The table wind speed should start where the user says. Set the range to stop at 90 mph.
Sample Run: NOTE: some question was raised about the difference column. 31.0 -26.0 is not 4.8. The difference is the actual difference between the two results from the formulas. The numbers that are output are rounded to no places, for the formulas, or one place for the difference. So the table is ok as it is.
Big Blue Wind Chill Enter air temperature (F): 30 Enter starting wind speed (mph): 4 Temperature = 30.0 degrees F Wind Speed Old Formula New Formula Difference 4 31.0 26.0 4.8 9 18.0 22.0 -3.5 14 11.0 19.0 -8.5 19 6.0 18.0 -12.0 24 2.0 16.0 -14.3 29 -1.0 15.0 -15.9 34 -3.0 14.0 -16.9 39 -4.0 13.0 -17.4 44 -5.0 12.0 -17.6 49 -6.0 12.0 -17.4 54 -6.0 11.0 -16.9 59 -6.0 10.0 -16.2 64 -6.0 10.0 -15.3 69 -5.0 9.0 -14.2 74 -4.0 9.0 -13.0 79 -3.0 8.0 -11.5 84 -2.0 8.0 -10.0 89 -1.0 7.0 -8.3
Another Run:
Big Blue Wind Chill Enter air temperature (F): 39.25 Enter starting wind speed (mph): 10 Temperature = 39.25 degrees F Wind Speed Old Formula New Formula Difference 10 28.0 33.0 -4.9 15 22.0 31.0 -8.9 20 18.0 29.0 -11.6 25 15.0 28.0 -13.5 30 13.0 27.0 -14.7 35 11.0 27.0 -15.5 40 10.0 26.0 -15.9 45 9.0 25.0 -16.0 50 9.0 25.0 -15.8 55 9.0 24.0 -15.4 60 9.0 24.0 -14.8 65 9.0 23.0 -14.0 70 10.0 23.0 -13.0 75 10.0 22.0 -11.9 80 11.0 22.0 -10.7 85 12.0 22.0 -9.4
Make sure you format the lines of the output as described above. Line breaks, spacing, spelling should be exactly like the sample runs.
Testing
First, read the assignment carefully. Look at how the program is supposed to behave. You do not know what the code looks like yet - that is fine. The assignment gives some examples of normal runs. Consider places where the equations can fail.
Make a test plan for this program. Save this doc file and fill in the table with test cases. You should actually calculate the values of the formulas for the first value of the windspeed, and their difference. Calculators ARE allowed! Do NOT just use the sample run numbers given above, make your own test cases using your own inputs. You should have a total of 7 non-redundant cases. Put your name and the section at the top of the file.
Submit this .doc file with your individual test cases at the link here.
Choose the menu choices of "TestCases" and "Program 1". This will be due on Tuesday February 4, midnight before the team development of test cases in lab on Wednesday February 5. Remember to bring this file with you to lab the next day to contribute to your team's effort. Your team should come up with 10 cases.
This NOAA government site has a windchill calculator for both old and new formulas where you can check your calculations. It's always better to have an independent way of checking your work. Do some research - read the NOAA government site to find out for what ranges the formulas are supposed to be defined.
Design
Just like you did in Lab 2 on design, decide on what steps you will need to perform to solve this problem. Make a numbered list and put it in Python form. Save this Python file as "design1.py".
# supply program prolog - fill this in! # main function # Step 1. Display introductory message # (some of your design here) # loop for the range of windspeeds desired with step of 5 # Step N. calculate the windchill for the current windspeed using the old formula # (more design goes here) # Step M. output to the shell the windspeed, the old windchill, the new windchill and the difference # (more design goes here)
and individually fill in the missing steps in the design. The N and M will depend on how many steps you put in the design. There should be at least 10 steps in the design.
There are some specifications that your program needs to meet.
This program uses user inputs; you will have to prompt the user for them.
You MUST use assignment statements to do your calculations, not calculating expressions in output statements.
You MUST use at least one math library function. Yes, there is a way to write the equation without using math functions, but the specification is to use a math function.
Note the types of data being output. Your program must match those.
Note the decimal places shown. Use the round function as needed. The numbers from the formulas are rounded to 0 places; the difference is rounded to 1 place.
Your code must be documented. You must use meaningful variable names. You must have a header / prolog. Your design must appear in between the Python statements.
Submit your .py file with the design in it with the link here.
Choose the menu choices of "Design" and "Program 1". It can be named anything you like as long as it is a py file. This is due by Tuesday February 11, midnight. Also bring this file with you to lab on Wednesday February 12, to contribute to your team's effort.
Implement the design
Individually write a Python program to implement your design. Start with a copy of the Python file you have that has the design in it (possibly updated with improvements you or your team came up with) and write your Python code between the commented lines of the design. Make sure you eliminate any syntax and semantics errors. Here is where test cases come in handy! Verify that it does come out with the correct answers. Your program must have a main function and call it to run the program.
Submit your individual source code (.py file) with the link here.
Choose the menu choices of "Code" and "Program 1". This is due by Sunday February 16, midnight.
Some useful references if you want to find out more about it
NOAA government site Most useful! Look here for ranges
Interesting article from New York Times about Wind Chill 2/10/04
Wind Chill for a Harley rider
Please read the documentation standard on the class web page. As you can see from looking at the grading page, we will be looking to see how you meet these standards. Note particularly that we require a header comment!
OldstyleWC = 0.081 ( 3.71velocity + 5.81-0.25 velocity)(tempF-91.4) + 91.4 NewStylewC 35.74+0.6215 tempF- 35.75 (velocity16)+0.4275 tempF (velocity.16)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
