CS 115 Project 1, Spring 2017:
Wind Chill Weather Report Calculator

[Back to CS 115 schedule]


Summary: In this project, you will write a program to compute Windchill Temperature (WCT) based on the National Weather Service's formula for windchill. The wind chill temperature is an effective temperature that records how people and animals feel when outside, based on how the skin surface loses heat through conduction, convection and radiation. The user of your program is interested in calculating WCT at several different locations throughout a city, where air temperature and wind velocity have been recorded.

Your program will ask the user to enter the number of locations for which WCT will be calculated, and the decimal precision to be used when reporting numbers. Thereafter, it will query the name, air temperature and wind velocity for each location. For each location, the program will compute WCT using the formula of the National Weather Service and outputing this data in the desired precision. Lastly, the program will report various summary metrics about the locations for which it was given data.

Due dates:

Part of this project is an exercise in having control over functions and patterns to produce target outputs. It is not a creative exercise, but rather the opportunity for you to demonstrate precision, control and being detail-oriented. You are asked to demonstrate the requested behavior and output, matching the sample output EXACTLY.


Checkpoint A (10 points)

For Checkpoint A, you will need to demonstrate a program that does the following:

  1. Welcomes user to the Windchill Temperature (WCT) Weather Report calculator.
  2. Prompts the user to enter the number of locations for which WCT will be calculated. For Checkpoint A, you can assume that the user always enters a positive integer (greater than zero).
  3. Prompts the user to enter the name of each location.
  4. Prompts the user to enter the air temperature and wind velocity for each location. You can assume that the user always enters a valid float value for these.
  5. Prints the WCT for each location, at the desired precision. WCT can be calculated using the National Weather Service calculation given at the bottom of this figure:

    NWS Windchill Equation

Sample input/output behavior for Checkpoint A are provided below. Your program's spacing, spelling, capitalization, and punctuation will need to match the sample output EXACTLY for this project. To some degree, you can also sanity-check your program using the WCT table published by the NWS, above.

HINT: To round a value to a certain precision, use the round() function. For example, say, you want to round a float called val to three decimal places, then the rounded value can be calculated using: round(val,3). Try it in PythonTutor.

HINT: To print something that is indented, use the '\t' meta-character, like this: print('\tI am indented'). Try it in PythonTutor.

Here is some sample input and output. Throughout this specification, sample user input is in green and the remaining is the output of the program.

The only way to get credit for Checkpoint A is to demo it for the course staff during any lab, drop-in tutoring or workshop before the due date. Consistent with the policy in the course syllabus, late project demos are not accepted.

NOTE: We will use additional sample inputs to test your demo and your final program, and so should you.

Checkpoint A - Sample 1

Example of output by the end of completing checkpoint A

Checkpoint A - Sample 2

Example of output by the end of completing checkpoint A


Checkpoint B (10 points)

For Checkpoint B, you will extend your code from Checkpoint A by printing the following summary statistics, using the user's requested decimal precision:

Sample input/output behavior for Checkpoint B are provided below. Your program's spacing, spelling, capitalization, and punctuation will need to match the sample output EXACTLY for this project.

The only way to get credit for Checkpoint B is to demo it for the course staff during any lab, drop-in tutoring or workshop before the due date. Consistent with the policy in the course syllabus, late project demos are not accepted.

Again: We will use additional sample inputs to test your demo and your final program, and so should you.

HINT: float('inf') is larger than every other float, and float('-inf') is smaller than any ever float. You may find these useful as variable initializers, when you are tracking minima and maxima.

Checkpoint B - Sample 1

Example of output by the end of completing checkpoint B

Checkpoint B - Sample 2

Example of output by the end of completing checkpoint B


Final Code

In your final code, you will extend the above code to handle two error scenarios:

There is no demo for your final code. Be sure to test your code with all cases provided in the grading rubric accompanying the Grading instructions below. Also, be sure to read the Submission instructions.

HINT: The exit() function in the sys library can be used to halt the program running and report an exit code back to the operating system. Please use exit(-1), which will report it as an error. Here is a little code demonstrating this, but note that it will not run in PythonTutor (which does not let you use the sys library). You will need to copy-paste the code and run it in a different environment.

Here is some sample input and output. In the below, sample user input is in green and operating system messages are in dark blue (matching the behavior of running the program via PyCharm).

Final Code - Sample 1

Example of output by the end of completing checkpoint B

Final Code - Sample 2

Example of output by the end of completing checkpoint B

Final Code - Sample 3

Example of output by the end of completing checkpoint B

Final Code - Sample 4

Example of output by the end of completing checkpoint B


Extra Credit (up to 10 points)

You can get extra credit by checking for more error conditions. For example, you could reject negative wind velocities (+2), or air temperatures that fall out of range of the most extreme temperatures reported on the surface of the earth (+2 for enforcing a well-reasoned min, +2 for enforcing a well-reasoned max), or wind velocities that exceed the speed of sound (+2). In each case, the program should display a user-friendly message before exiting. Feel free to think up others your own, but you will get max +2 points for each, and no more than 10 points total for extra credit.

Note: Be sure you describe any extra-credit work in your docstring, explaining the judgements you made and you must include references justifying these judgements.


Grading

Correctness [55%]

The most important part of your grade is the correctness of your final program. Your program will be tested numerous times, using different inputs, to be sure that it meets the specification. You will not get full credit for this 50% unless your output matches the sample output exactly for every case, including capitalization and spacing. Attention to detail will pay off on this assignment. A detailed grading sheet for this project is posted here.

Programming Design and Style [25%]

In addition to being correct, your program should be easy to understand and well documented. For details, see the grading sheet above.

Checkpoints [20%]

Your checkpoints are each worth 10 points, as described above. The checkpoints cannot be submitted late.


Submission

You should submit your final code on Moodle by the deadline. I strongly encourage you to take precautions to make and manage backups while you work on your project, in case something goes wrong either while working or with your submission to Moodle.

Name the file you submit to Moodle yourlastnameP1.py, substituting your actual last name (in lowercase) for yourlastname.

Collaboration policy

Programming projects must be your own work, and academic misconduct is taken very seriously. You may discuss ideas and approaches with other students and the course staff, but you should work out all details and write up all solutions on your own. The following actions will be penalized as academic dishonesty:

Late policy

There is a 48-hour grace period associated with the final project deadline. This grace period is designed to only cover small personal emergencies and other unexpected events. No other consideration will be given for these small emergencies.

References

This assignment is based on the CS1 "Windchill" assignment by Bill Punch and Richard Enbody (Michigan State University), published via NCWIT's EngageCSEdu project.