CS 107 - Windchill Calculations

Machine Problem #1 - Due: 2/3/2003 at 2:00 pm

Sample Windchill Results

On November 1, 2001 the National Weather Service replaced the old Windchill formula based on the 1945 Siple and Passel Index with a new formula based on research done by the Office of the Federal Coordinator for Meteorological Services and Supporing Research (OFCM).

The Siple and Passel Formula is:

     WCT = 0.045*(5.2735*SQROOT(W) + 10.45 - 0.2778*W)*(T-33.0) + 33

     where:  WCT = Windchill Temperature (degrees Celsius)
             W = wind speed (Km/hr)
             T = air temperature (degrees Celsius)
             SQROOT = square root function
To use this in the United States, we will need to convert between Celcius and Fahrenheit and from miles per hour to kilometers per hour. These formulas are:
     TC = (TF - 32) * 5/9
     TF = 9/5 * TC + 32
     1 KPH = 1.609 0.6215 MPH  
     KPH = 1.609 * MPH  

     where: TC = Temperature in Celcius
            TF = Temperature in Fahrenheit
            KPH = Kilometers per Hour
            MPH = Miles per HOUR
The new OFCM formula is:
     WCT = 35.74 + 0.6215*T - 35.75 * (V0.16) + 0.4275 * T * (V0.16)

     where: WCT = Windchill Temperature (degrees Fahrenheit)
            T = air temperature (degrees Fahrenheit)
            V = wind speed (mph)
You are to write a program that will prompt the user for two numbers
  1. Wind Speed in Miles per Hour
  2. Air Temperature in degrees Fahrenheit
Your program is to calculate and output both the old and the new windchill values and the difference between the two windchill values.

A few items to note that your program must account for to earn full marks:

  1. Wind speed must be from 0 to 100 mph inclusive. If a wind speed is given that is outside of this range, output a message stating that the windspeed must be in the given range.
  2. The old (Siple and Passel) formula assumes the windchill temperature is equal to the air temperature if the wind speed is 4 mph or less.
  3. The new (OFCM) formula assumes the windchill temperature is equal to the air temperature if the wind speed is 3 mph or less.
  4. Both formulas assume windchill temperature is equal to the air temperature if the air temperature is 50°F or more.

Your program must be written using good programming style. This includes (but is not limitted to) such items as:

Your program will be submitted electronically on the icarus system using the turnin command. The project name for this will be mp1. Your program will graded based on how it executes on the icarus system using the g++ compiler. Getting a program to work on another system or using another compiler does NOT mean it will work on the icarus system using the g++ compiler. Programs that do not work properly on the icarus system using the g++ compiler will lose points. Also programs that are not submitted via the turnin command will also lose points. Emailing a program is not an acceptable form of electronic submission.