Question
C++ Program The original formula for winds in miles-per-hour and Fahrenheit temperatures was based on those experiments: h = 0.0817(3.71 + 5.81 0.25)( 91.4) +
C++ Program
The original formula for winds in miles-per-hour and Fahrenheit temperatures was based on those experiments:
h = 0.0817(3.71 + 5.81 0.25)( 91.4) + 91.4 where T is the current temperature in degrees Fahrenheit and V is the wind speed in miles per hour. The result is in
degrees Fahrenheit.
In the fall of 2001, the U.S. National Weather Service replaced this formula with a new one. The new formula is based on greater scientific knowledge and on experiments that tested how fast the faces of volunteers cooled in a wind tunnel with various combinations of wind and temperature. The NEW formula is:
h = 35.74 + 0.6215 35.75(0.16) + 0.4275(0.16) Again, T is the current temperature in degrees Fahrenheit and V is the wind speed in miles per hour and the result is in
degrees Fahrenheit.
Design and write a program that, given the current temperature and wind speed, will calculate and display the current temperature and wind speed; the wind chill temperature using the new formula; the wind chill temperature using the old formula; and the difference between the new and old temperatures.
The wind chill temperatures will obviously be floating point numbers, even if whole numbers are entered for temperature and wind speed. These should be output with one digit to the right of the decimal point (fixed...showpoint...setprecision). The temperature difference, however, is displayed with 3-digit precision and must always be positive (think fabs).
USE cmath functions wherever possible in your calculations
Although we don't know their exact meaning (unless you are better at finding this out than I have been!), you MUST use named constants (const) for the numbers in the formulas. (Even something like OLD_FACTOR_1 and so on, or POWER for the 0.16 would work. I imagine some of you will be more creative than that!) I will also be looking for good variable names (for example, something more obvious than T and V). Everything all nicely lined up in lines and columns could be worth a little extra credit.
Dont forget to include the program header (your name, date, etc.) in your code, comments, and white space/blank lines to make the code readable.
When you are satisfied that the program executes correctly (there are wind chill charts on line that you can use to double-check your calculations). Play with the numbers a bit it is interesting to note where the differences in the two formulas are greatest and smallest.
Capture screen shots of the following four runs of your program.
RUN #1 Temperature 35
Wind Speed 45 mph
RUN #2
32 degrees
30 mph
RUN #3
10 degrees
15 mph
RUN #4
-30 degrees
10 mph
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started