Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need a C program to print 2 tables of temperature values converting Celsius to Fahrenheit. The first table should display the following columns: -Temperature

I need a C program to print 2 tables of temperature values converting Celsius to Fahrenheit.

The first table should display the following columns:

-Temperature in Celsius

-Temperature in Fahrenheit

-Several columns of Temperature in Fahrenheit which include Wind Chill factor. One column for each wind speed value starting @5mph up to 40mph in increments of 5mph.

The second table should display the following columns:

-Temperature in Celsius

-Temperature in Fahrenheit

-Several columns of Temperature in Fahrenheit which include Heat Index factor. One column for each relative humidity percentage starting at 40% up to 100% in increments of 10.

The headings for each column must also be printed i.e. Celsius, Fahrenheit, Wind speed (or Heat index) value. If any temperature value is not valid for either Wind Chill calculation or Heat Index calculation print a X in that column.

Formulas: Windchill Index:

-Wind chill temperatures are valid for temperatures up to 50 degrees Fahrenheit only and when the wind speed is 5 miles or more.

Heat Index:

-Heat index formula is valid only when the temperature is 80 deg Fahrenheit or above and when the relative humidity is 40% or more.

Functions: Function Compute_Wind_Chill () Input arguments: Integers for range of Celsius temperature values (1 Input argument for starting Celsius value, 1 Input argument for ending Celsius value) Output arguments: None Function Return value: Integer containing number of Fahrenheit values below 20 degrees. 1. This function converts temperature from Celsius to Fahrenheit for the range of temperatures provided in steps of 1 degree increments. 2. The Table should show the original Celsius and the computed Fahrenheit temperature as the first 2 columns and then additional columns for Wind Speeds from 5mph to 40 mph in increments of 5. The Fahrenheit temperature for each wind speed with Wind Chill factor must be printed under the particular Wind Speed column. 3. At the end, function should return count of temperature values less than 20.

Function Compute_Heat_Index () Input arguments: Integers for range of Celsius temperature values (1 Input argument for starting Celsius value, 1 Input argument for ending Celsius value) Output arguments: None Function Return value: Integer containing number of Fahrenheit values above 100 degrees. 1. This function converts temperature from Celsius to Fahrenheit for the range of temperatures provided in steps of 1 degree increments. 2. The table should show the original Celsius and the computed Fahrenheit temperature as the first 2 columns and additional columns for Relative Humidity from 40% to 100% in increments of 10. The Fahrenheit temperature for each relative humidity with Heat Index factor must be printed under the particular Relative Humidity column. 3. At the end the function should return count of temperature values greater than 100.

For both computations irrelevant columns should contain a X (i.e. if the initial Fahrenheit temperatures are greater than 50 for Wind Chill and less than 80 for Heat Index)

You need to use a Nested FOR statement to calculate and print values for each table.

The Main Function should display some information to the user as to how the program works. It should take input from the user for specifying the range of values (double), if the range is outside of -20 to 50 an error message should be displayed and the user must be prompted to enter new values. The program does not need a loop to keep gathering new inputs from the user if a correct range of values are entered. If a valid range is input by the user, it calls the functions Compute_Wind_Chill() and Compute_Heat_Index() to compute and print the two tables of values. After returning from each function, the main() function prints information about the total number of extreme temperature values (i.e. totals of wind chill less than 20 and totals of heat index above 100).

Output Example: if the first inputs are -5 and 20

The first table should look like this:

image text in transcribed

And the second table should look like this:

image text in transcribed

18 program converts temperature values from celsius to Fahrenheit and also factors in Wind Chill and Heat Index at the appropriate temperatures Please enter the range of temperature values (in Celsius between -20 and 50) to be converted: Celsius to Fahrenheit with Wind Chill factor Celsius FahrenheitSmph 10mph 15mph 20mp 25mph 30mph 35mphmph 23.00 16.50 12.57 10.06 8.18 6.66 5.37 4.263.2 24.80 18.62 14.80 12.37 10.54 26.60 20.73 17.03 14.67 12.90 11.47 10.26 9.21 8.28 28.40 22.85 19.27 16.98 15.26 13.88 12.71 11.69 10.79 30.20 24.96 21.50 19.28 17.62 16.28 15.1514.1713.30 32.00 27.08 23.73 21.5919.99 18.69 17.60 16.65 15.81 33.80 29.19 25.96 23.89 22.35 21.10 20.0419.12 18.31 35.60 31.30 28.1926.20 24.71 23.50 22.49 21.60 20.82 37.40 33.42 30.4228.51 27.07 25.91 24.93 24.08 23.33 39.20 35.53 32.65 30.81 29.43 28.32 27.38 26.56 25.83 41.00 37.65 34.88 33.12 31.79 30.72 29.82 29.04 28. 34 42.80 39.76 37.11 35.42 34.15 33.13 32.26 31.51 30.85 44.60 41.88 39.34 37.7336.52 35.54 34.71 33.99 33.36 46.40 43.99 41.57 40.03 38.88 37.94 37.1536.4735.86 48.20 46.10 43.81 42.3441.24 40.35 39.60 38.95 38.3 50.00 51.80 53.60 55.40 57.20 59.00 60.80 62.60 64.40 66.20 68.00 9.06 7.82 6.74 5.78 10 12 13 14 15 16 17 18 19 20 Extreme Cold : 43 18 program converts temperature values from celsius to Fahrenheit and also factors in Wind Chill and Heat Index at the appropriate temperatures Please enter the range of temperature values (in Celsius between -20 and 50) to be converted: Celsius to Fahrenheit with Wind Chill factor Celsius FahrenheitSmph 10mph 15mph 20mp 25mph 30mph 35mphmph 23.00 16.50 12.57 10.06 8.18 6.66 5.37 4.263.2 24.80 18.62 14.80 12.37 10.54 26.60 20.73 17.03 14.67 12.90 11.47 10.26 9.21 8.28 28.40 22.85 19.27 16.98 15.26 13.88 12.71 11.69 10.79 30.20 24.96 21.50 19.28 17.62 16.28 15.1514.1713.30 32.00 27.08 23.73 21.5919.99 18.69 17.60 16.65 15.81 33.80 29.19 25.96 23.89 22.35 21.10 20.0419.12 18.31 35.60 31.30 28.1926.20 24.71 23.50 22.49 21.60 20.82 37.40 33.42 30.4228.51 27.07 25.91 24.93 24.08 23.33 39.20 35.53 32.65 30.81 29.43 28.32 27.38 26.56 25.83 41.00 37.65 34.88 33.12 31.79 30.72 29.82 29.04 28. 34 42.80 39.76 37.11 35.42 34.15 33.13 32.26 31.51 30.85 44.60 41.88 39.34 37.7336.52 35.54 34.71 33.99 33.36 46.40 43.99 41.57 40.03 38.88 37.94 37.1536.4735.86 48.20 46.10 43.81 42.3441.24 40.35 39.60 38.95 38.3 50.00 51.80 53.60 55.40 57.20 59.00 60.80 62.60 64.40 66.20 68.00 9.06 7.82 6.74 5.78 10 12 13 14 15 16 17 18 19 20 Extreme Cold : 43

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Databases

Authors: Ian Robinson, Jim Webber, Emil Eifrem

1st Edition

1449356265, 978-1449356262

More Books

Students also viewed these Databases questions

Question

Cierra el caj n con un de metal para mayor seguridad.

Answered: 1 week ago