Windchill

From CompSciWiki
Revision as of 18:52, 23 September 2010 by WikiSysop (Talk | contribs)

Jump to: navigation, search

Back to the Program-A-Day homepage

Problem

As you know from living in Winnipeg, wind can make the air temperature feel much colder. Write a program that will use Scanner to read in an air temperature and a wind speed. Then use the formula below to calculate and output the windchill.


<math>T_{wc}=13.12 + 0.6215 T_a-11.37 V^{0.16} + 0.3965 T_a V^{0.16}\,\!</math>
where <math>T_{wc}\,\!</math> is the wind chill index based on the Celsius scale, <math>T_a\,\!</math> is the air temperature in °C, and <math>V\,\!</math> is the air speed in km/h measured at Template:Convert, standard anemometer height).
Equation taken from Wikipedia which cites http://www.msc.ec.gc.ca/education/windchill/science_equations_e.cfm


Sample output with location Winnipeg, air temperature -10 and wind speed 30:

Location: Winnipeg
Current Temperature: -10.0 Celsius
Wind Speed: 30.0 km/h
Temperature with Windchill: -19.52049803338773
Programmed by A. Student
**End of Program**
 

Java Fundamentals

Wiki chars03.jpg

Solution

Code

Code

Solution Code

Back to the Program-A-Day homepage