Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem: Given the temperature T of the air and the wind speed v, calculate the wind chill Twe: the temperature felt by humans and
Problem: Given the temperature T of the air and the wind speed v, calculate the wind chill Twe: the temperature felt by humans and animals in a cold wind. Temperatures and the wind speed are double precision. The coefficients (35.74, 0.6215, -35.75, 0.4275) and exponent (0.16) are required to be defined constants. One mile is defined as 1.609344 kilometers. This is also a required defined constant. The user can choose to enter either US customary units (degrees Fahrenheit and miles per hour) or SI units (degrees Celsius and kilometers per hour). The program always displays the inputs in US units. The equation above requires I to be in degrees Fahrenheit and v to be in miles per hour. The result Twc is the US wind chill in degrees Fahrenheit. Convert the US wind chill to degrees Celsius for the SI wind chill. Use \302\260 in your printf format strings to display the degree symbol (). Use the + flag for the temperature and wind chill placeholders in your printf format strings to force a plus sign to be displayed for positive numbers. See p. 58 of the Forouzan & Gilberg textbook. This assignment requires the implementation of the selection by calculation technique. See p. 51-52 of the course notes packet. Example Execution #1: (Recent local weather) Enter 1 for US units, 2 for SI -> 1 Enter temperature (F) -> 11 Enter wind speed (mph) -> 14 Temperature: Wind speed: US wind chill: SI wind chill: T = 35.74 +0.6215T - 35.75 v0.16 + 0.4275 Tv0.16 wc +11.0 F Example Execution # 2: (Example #1 in SI units) Enter 1 for US units, 2 for SI -> 2 Enter temperature (c) -> -11.67 Enter wind speed (kph) -> 22.53 Temperature: Wind speed: US wind chill: SI wind chill: 14.0 mph -4.8 F -20.4 C Temperature: Wind speed: 14.0 mph US wind chill: -4.8 F SI wind chill: -20.4 C =-=-=- +11.0 F Example Execution #3: (Ice Bowl, 1967) Enter 1 for US units, 2 for SI -> 1 Enter temperature (F) -> -15 Enter wind speed (mph) -> 12 -15.0 F 12.0 mph -36.3 F -38.0 C ====== Example Execution #4: (Mount Washington, 2023) Enter 1 for US units, 2 for SI -> 1 Enter temperature (F) -> -46 Enter wind speed (mph) -> 97 Temperature: Wind speed: US wind chill: -108.1 F SI wind chill: -77.8 C === ==== Temperature: Wind speed: US wind chill: SI wind chill: -46.0 F Example Execution # 5: (Projected local weather) Enter 1 for US units, 2 for SI -> 1 Enter temperature (F) -> 46 Enter wind speed (mph) -> 4 Temperature: Wind speed: US wind chill: SI wind chill: 97.0 mph =-=-=- =-= Example Execution #6: (Recent local weather) Enter 1 for US units, 2 for SI -> 2 Enter temperature (c) -> -15 Enter wind speed (kph) -> 11 +46.0 F 4.0 mph +44.2 F +6.8 C +5.0 F 6.8 mph -6.9 F -21.6 C === Additional Requirements: 1. Add the homework assignment header file to the top of your program. A description of your program will need to be included in the assignment header. This particular header can be added to your file by entering : hhw while in command mode in vi. 2. Each of the example executions provided for your reference represents a single execution of the program. Your program must accept input and produce output exactly as demonstrated in the example executions. Do not add any "bonus" features not demonstrated in the example executions. Your program will be tested with the data seen in the example executions and an unknown number of additional tests making use of meaningful data. You may rely on the following assumptions: o The user will only enter either 1 or 2 for their choice of units. O The temperature will be 50 degrees Fahrenheit or lower. The wind speed will be at least three miles per hour.
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