CIS 2279 Homework Assignment #06
Due Friday, Sep 30,
2011
All files created must be saved in your class directory
/mnt/homes/CLASSES/CIS2279/<username>
- Create a perl script named lab06.pl in your user directory. The
script that has the following features: (5 pts. each)
- Asks the user to input the temperature (in degrees F),
and wind speed (mph).
- Create a subroutine that takes the temperature and wind speed
as arguments and returns the wind chill.
- Create a subroutine that takes a temperature in F and returns
the value in C.
- Create a subroutine that takes a temperature in F and returns
a temperature value in degrees Kelvin
- Using these subroutines, calculate the wind chill and print
the values to the screen in degrees F, C and K
Wind Chill (F) = 35.74 + 0.6215(T) - 35.75(V0.16) +
0.4275(T)(V0.16)
Where T = temperature in degrees F and V = wind velocity in MPH.
Celcius = (TempF - 32)/1.8
- 10% bonus - create a subroutine in the script above that will
return the dew point (in degrees F,C and K) using the given temperature
and RH%. You will need to prompt the user to input the RH value.
Print the dew point to the screen in F, K and C using some descriptive text.
$dewpt = ((1/$temp_k) - (1/5412 * log($rh/100) ))**-1;
Where $temp_k is the temperature in Kelvin degrees and
$rh is the relative humidity as an integer
(ex. 88.4). You will need to convert the input temperature to
Kelvin (temp C + 273.15). The output of the above equation will
be in Kelvin degrees so you will need to convert back to F.
Creating an additional subroutine for the conversions might not be
a bad idea.
Solution
last updated: 05 Oct 2011 14:26