CS 115 Program 1 Windchill Calculation Spring 2018

Due Dates:
Individual Design: Wednesday, February 14, midnight
Individual Source: Sunday, February 25, midnight

Assignment total points = Design (20 points) + Runs given test cases successfully (20 points) + Implementation correctly written (70 points) + Style and documentation (15 points) = 125 points

Submit your work with the link here. Use Program 1 and Design for the design, Program 1 and Code for source code.

Note that there is a FAQ about program 1. Please read this! It will save you points!

Note about collaboration: As stated in the syllabus and the first day of class, you are allowed to choose ONE other student from this class and work with them as a partner. The other student may NOT have already worked with someone else in the class. Pairs are allowed, not chains nor networks! And choose partners BEFORE the due date. You do not want to make your partner late too! You must reference your partner AND they must reference you in submitted work. All program source code and designs will be checked for similarity. If similarity is found and no references are given, it will be investigated for plagiarism.

Educational Goals: The educational goals of this program are that the student should use the concepts of

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?

Here are the formulas you need:

where velocity is the wind speed in miles per hour and tempF is the Fahrenheit temperature.

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: wind speed, the windchill according to the new formula, windchill according to the old formula and the difference between the two windchills. The table should be nicely labeled. Some suggestions for formatting are given below. The column of wind speeds should start at the value the user gives. Set the range to stop at 90 mph. The step size is set at 5.

Sample Run:

Big Blue Chill

Starting Wind Speed (in miles per hour): 1
Air temperature (in F degrees): 15
Speed cannot be 3 or below.  4 mph used instead

Temperature 15.0 F

        Windspeed       New Formula     Old Formula     Difference

               4            8.44            15.7            -7.3
               9            3.37           0.492             2.9
              14           0.311            -8.8             9.1
              19           -1.93           -15.2            13.3
              24           -3.72           -19.9            16.2
              29           -5.22           -23.3            18.1
              34           -6.51           -25.8            19.3
              39           -7.66           -27.6            19.9
              44           -8.69           -28.8            20.1
              49           -9.62           -29.5            19.9
              54           -10.5           -29.7            19.2
              59           -11.3           -29.6            18.3
              64           -12.0           -29.2            17.2
              69           -12.7           -28.5            15.8
              74           -13.3           -27.6            14.3
              79           -14.0           -26.4            12.4
              84           -14.5           -25.0            10.5
              89           -15.1           -23.5             8.4

Another Sample Run:

Big Blue Chill

Starting Wind Speed (in miles per hour): 10
Air temperature (in F degrees): -20

Temperature -20.0 F

        Windspeed       New Formula     Old Formula     Difference

              10           -40.7           -44.3             3.6
              15           -45.0           -56.8            11.8
              20           -48.2           -65.6            17.4
              25           -50.8           -72.0            21.2
              30           -53.0           -76.7            23.7
              35           -54.9           -80.1            25.2
              40           -56.6           -82.5            25.9
              45           -58.1           -84.1            26.0
              50           -59.5           -85.0            25.5
              55           -60.8           -85.2            24.4
              60           -62.0           -85.0            23.0
              65           -63.1           -84.3            21.2
              70           -64.1           -83.2            19.1
              75           -65.1           -81.8            16.7
              80           -66.0           -80.0            14.0
              85           -66.9           -77.9            11.0

Make sure you format the lines of the output as described above. Line breaks, spacing, spelling should be very similar to the sample runs.


These test cases will be used to test your program when the TAs are grading. It's only wise to make sure that your program runs these successfully. The example runs above also are used as test cases.

The numbers given here are representing the numbers in the first row of the table generated by the inputs shown.
Description of CasesInputs Expected Outputs / Actions
Wind SpeedTemperatureNew formulaOld formula DifferenceAction
1. Normal speed (number > 3) and temperature (number <= 50) 8 35 28.526.1 2.4
2. Boundary speed and normal temperature 4 30 25.830.6-4.8
3. Boundary speed and float temperature 4 25.520.626.1 -5.5
4. Boundary speed and very low temperature 4 -100-124.4 -98.2 -26.2
5. Speed past bound of table, normal temperature 95 10 Table has only headers, no data
6. Speed below the boundary, normal temperature 0 10 2.7 10.8-8.1 set speed to 4 mph
7. Normal speed, negative temperature 10 -10 -28.3 -32.13.8
8. Normal speed and temperature past upper bound 30 75 42.028.913.1 temp set to 50 degrees
9. Normal speed and temperature at upper bound 20 50 43.633.010.6

This NOAA site has a windchill calculator for the new formula, 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.


Make a list of steps to solve this problem and put it in Python comment form. Save this Python file as "design1.py".
# supply program prolog  - fill this in! personal info, 3 P's, references
#  main function
    # Display introductory message
    # (some of your design here)
    # loop for the range of windspeeds desired with stepsize of 5
    #     Calculate the windchill for the current windspeed using the old formula 
    #     (more design goes here)
    #     Output the windspeed, the new windchill, the old windchill and the difference
    #     (more design goes here)
and fill in the missing steps in the design.

There are some specifications that your program needs to meet.

Implement the design

Individually write a Python program to implement your design. You can use the assistant of tutors, any TA, your instructor, the Net, and one student from CS 115 who is not working (nor has been working) with any other student. Any of these resources that you use must be referenced in your program header. Start with a copy of the Python file you have that has the design in it (possibly updated with improvements you 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 are required! Verify that your program 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 at the top of the page. here.

Choose the menu choices of "Code" and "Program 1". This is due by Sunday February 25, midnight.

Some useful references if you want to find out more about it

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.