Humidex

From CompSciWiki
Revision as of 12:12, 24 March 2011 by CameronH (Talk | contribs)

Jump to: navigation, search

Humidex is a measurement that gives people an idea of how hot it feels, as opposed to how hot it actually is. For example, on days with a high temperature and high humidity, people often think it's hotter than it actually is. Write a complete Java program that will ask the user for the dew point and the air temperature. Then use the formulas given to calculate and output the humidex.


Input

Use Scanner class method nextDouble to prompt the user to input D (dew point) and T (air temperature). Use System.out.println to provide an input prompt. Remember to tell the user to enter values in Celsius.

Processing

The formula for calculating the humidex is: R = 6.11 * e[5417.7530 * ( (1/273.16) - (1/(273.16 + D)) ) ] H = (0.5555) * (R - 10.0) humidex = T + H NOTES: - e is Euler's number (e = 2.71828182845904523536....) To access Euler’s number use the Math constant Math.E - D is the dew point, in Celsius. The user will input this value. - T is the air temperature, in Celsius. The user will also input this value.

Output

Echo the input and then print the output using System.out.println. Use Math.round() to round all output to one decimal place.










EPIC FAIL