Difference between revisions of "Windchill"

From CompSciWiki
Jump to: navigation, search
Line 1: Line 1:
 
{{1010PrAD|ProblemName=Windchill
 
{{1010PrAD|ProblemName=Windchill
  
|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.  
+
|Problem= As you know from living in Winnipeg, wind can make the air temperature feel much colder. Write a program that will uses JOptionPane to read in an air temperature and a wind speed. Then use the formula below to calculate and output the windchill.  
  
  

Revision as of 19:00, 23 September 2010

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 uses JOptionPane 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.
Equation taken from Wikipedia which cites http://www.msc.ec.gc.ca/education/windchill/science_equations_e.cfm


Hint: Use Math.pow to complete the equation.
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**
 

Introducing Math methods

Wiki chars03.jpg

Solution

Code

Solution Code

Back to the Program-A-Day homepage