A Problem Solved: Wind Chill

In this lesson, we will design and implement a Java solution to a mathematical problem.

We'll cover the following

Problem statement

The effect of wind on the human body can make one feel colder than the air temperature might suggest. The combined effect of wind and temperature is called the wind-chill temperature. Suppose that the National Weather Service wants you to write a Java program to compute the wind-chill temperature given the air temperature and wind velocity.


According to the U.S. National Weather Service, the wind chill temperature is calculated by the following formula:

W = c1 + c2 × Tc3 × V0.16 + c4 × T × V0.16

where T is the current air temperature in degrees Fahrenheit, V is the velocity of the wind in miles per hour, c1 is 35.74, c2 is 0.6215, c3 is 35.75, and c4 is 0.4275.

When wind speeds are less than 3 miles per hour, the previous formula will give you a wind chill that is higher than the actual temperature. When you are standing still in a light breeze, your body warms the air near you. This warm air insulates your body somewhat from the colder environment. As a result, it may actually feel warmer than the actual temperature.

The program

The program given below evaluates the wind-chill formula. Before we look at the details of the program, run it for a temperature of 35 degrees Fahrenheit and a wind speed of 5 miles per hour. The result should be a wind chill of 31 degrees.

Get hands-on with 1200+ tech skills courses.