CIS 1.5 (Science Section)
Professor Langsam
Assignment #2
Wind Chill is the apparent temperature felt on exposed skin due to the combination of air
temperature and wind speed. The National Weather Service[1],[2]
defines the wind chill index as follows:
where:
Twc is the wind chill index in °F
Ta is the air temperature in °F
V is the air speed in miles per hour.
The formula is not valid if Ta is larger than 50 or if V is larger than 120. Also note that Fahrenheit and Celsius are related by the following formulas:
and
Write a program that reads a file, weather.dat, which contains an unknown number of items representing temperatures (in either, Fahrenheit or Celsius) and air speeds (in mph) and calculates the wind chill index for each pair. After printing the wind chill factor for each measurement in the file, print the average temperature, average air speed and average wind chill index.
Strategy
Be sure to comment, neatly format your program, and use meaningful variables as described in class. All output is to be to a file.
Use the following data:
Temperature Air Speed
32 F 20
2 C 25
75 F 10
5 C 35
15 F 35
25 F 150
0 F 25
0 C 35
-5 F 45
-1 C 25
10 F 15
10 F 15