When human skin is exposed to cold air, it loses heat. As air flow increases, the rate at which heat is lost increases. Hence, it feels colder on a windy day than on a calm day, even if the air temperatures are the same.
For a given air temperature T and wind velocity V, the windchill temperature WCT(T,V) is the temperature at which windless air would have the same cooling effect upon exposed skin. In other words, a still-air temperature of WCT(T,V) feels similar to an air temperature of T with wind velocity V.
According to the Wikipedia entry, the accepted formula for windchill temperature in North America and the United Kingdom, which was developed by scientists and medical experts on the Joint Action Group for Temperature Indices, is
where T is measured in degrees Fahrenheit and V is measured in miles per hour. Note that this formula is not intended to be applied when either T > 50 or V ≤ 3.
For this assignment, you are to finish the development of a very incomplete Java application, called WindChill, that produces a column of wind chill values for a fixed air temperature and a range of wind velocities beginning at 10MPH and going up to, but not beyond, 60MPH. The air temperature and the gap between successive wind velocities are provided as inputs by the user in response to prompts produced by the program.
To illustrate the intended behavior of the program, here are two sample executions (with user input shown in red):
Enter temperature:> 45 Enter wind speed increment:> 7 Wind | 45 (F) -----+------------------- 10 | 39.83967578555787 17 | 37.7247773181861 24 | 36.250908058772126 31 | 35.10324100734434 38 | 34.15609008998768 45 | 33.345747701258624 52 | 32.635202555251745 59 | 32.000938055240866 |
Enter temperature:> 32 Enter wind speed increment:> 5 Wind | 32 (F) -----+------------------- 10 | 23.72714425963738 15 | 21.588988890532022 20 | 19.985584187795496 25 | 18.690054638876813 30 | 17.59665069469402 35 | 16.64697808585142 40 | 15.805187243201992 45 | 15.047598895792746 50 | 14.357708741202643 55 | 13.723528906697098 60 | 13.136062577649774 |
Notice that both inputs are expected to be integer values.
In order to complete the program, you will have to insert code that does each of the following:
Of course, you will need to formulate a for loop having a loop control variable that iterates through all the relevant wind velocities.
Make sure to complete the "header" comments that
It should go without saying that any method you introduce should be accompanied by comments that describe its purpose.