Problem: Given the temperature T of the air and the wind speed v, calculate the wind...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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. 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.
Expert Answer:
Related Book For
Posted Date:
Students also viewed these algorithms questions
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
answer the question clearly You are building a flight-control system for which a convincing safety case must be made. Would you assign the tasks of safety requirements engineering, test case...
-
Most websites have images. There are many different features and functionalities that can be used to work with images via the use of JavaScript. These include preloading, rollovers, and cycling...
-
On January 1, 2017, the Mount Rogers city water department leases a truck under a non-cancelable lease agreement meeting the requirements for classification as a capital lease. The present value (8...
-
The common stock of Teledyne trades on the NYSE. Teledyne has never paid a cash dividend. The stock is relatively risky. Assume that the beta for Teledyne is 1.3 and that Teledyne closed at a price...
-
Which of the following is a characteristic of all plants? (a) seeds (b) pollen (c) swimming sperm (d) alternation of generations
-
A division is considering the acquisition of a new asset that will cost $720,000 and have a cash flow of $252,000 per year for each of the four years of its life. Depreciation is computed on a...
-
If the same data were reported for car insurance, instead of health insurance, would the graph look similar? Why or why not?
-
Large central power stations (about 1000 MW electrical) using fluidized bed combustors may be built some day These giants would be fed 240 tons of coallhr (90% C, 10 % H2,), 50% of which would burn...
-
Mr. and Mrs. Spirit purchased a $35,000 house 20 years ago. They took a 30-year mortgage for $30,000 at a 3% annual interest rate. Their bank, the First Amityville National Bank, has recently offered...
-
Louis Vuitton v. Louis Vuiton Dak. In what way is a law violated? Discuss whether you believe the infringement claim is valid. How, if at all, is the Internet involved? Why do you consider this issue...
-
What is the importance of this topic On your research paper How has COVID-19 impacted employees working remotely? Are these effects negative or positive? What are the advantages and disadvantages of...
-
Moving on, you begin compiling a list of all of Fred's creditors. He tells you that he has one very dear friend who loaned him $5,000 last year to help Fred pay his children's private school tuition....
-
The Spring Valley Detention Center serves as the jail for all law enforcement agencies in Smith County. While county jails are usually operated by the county sheriff, the Spring Valley facility is...
-
learning about Agency Law. Both "employees" and "independent contractors" are "agents" but the law treats "employees" very differently than "independent contractors" in many ways. The explosive...
-
Sickle cell anemia is: Caused by mutations in either the alpha-globin gene or the beta-globin gene. An autosomal dominant disease. An X-linked recessive disease. Always caused by the same point...
-
How has the globalization of firms affected the diversity of their employees? Why has increased diversity put an additional burden on accounting systems?
-
The surface of many airfoils can be described with an equation of the form y = tc/0.2 [a0x/c + a1 (x/c) + + a2(x/c)2 + a3(x/ c)3 + a4(x/c)4] where t is the maximum thickness as a fraction of the...
-
Biological oxygen demand (BOD) is a measure of the relative oxygen depletion effect of a waste contaminant and is widely used to assess the amount of pollution in a water source. The BOD in the...
-
Stirling's approximation for large factorials is given by: n! = 2n(n/e)n Use the formula for calculating 20!. Compare the result with the true value obtained with MATLAB's built-in function factorial...
-
List and describe three general ways that the functions of transcription factors can be modulated.
-
The binding of small effector molecules, protein-protein interactions, and covalent modifications are three common ways to modulate the activities of transcription factors. Which of these three...
-
The gene that encodes the enzyme called tyrosine hydroxylase is known to be activated by the CREB protein. Tyrosine hydroxylase is expressed in nerve cells and is involved in the synthesis of...
Study smarter with the SolutionInn App