Part A
Write a function windChillCalculator to determine the wind chill. Your main function should take in user inputs for T (air temperature) and V (wind speed) and pass these values as parameters to your function. After your function calculates the wind chill it should return it to main. To test your code, for T = 30.0 and V = 5.0, you should get a Wind Chill of 24.7268. Within your main function, print the following cout statement: cout << "The wind chill is " << wind_chill << " degrees F." << endl; HINT: Look at the pow() function in the C++ math.h library
Part B
Once you have the wind chill calculation working, create another function printWindChill. This function should call windChillCalculator and print all the wind chill values for a fixed temperature and variable wind speeds. You will need to write a loop in this function to iterate over the different wind speeds. The function should receive T (air temperature), low_wind_speed, high_wind_speed, and wind_speed_step as input parameters. For Example: Let the input parameters be T = 30.0, low_wind_speed = 5.0, high_wind_speed = 8.0, and wind_speed_step = 1.0, your function should print out the wind chill for a temperature of 30 °F and wind speeds starting from 5 mph and ending at 8 mph, incrementing by 1 mph. (5 mph, 6 mph, 7 mph, and 8 mph) Use the following cout statement to output the values from within the function: cout << "The wind chill is " << wind_chill << " degrees F for an airtemperature of " << T << " degrees F" << " and a wind speed of " << V << " mph." << endl;
Part A:
Screenshot of the code:
Output:
Code to copy:
//Include the required header file.
#include <iostream>
#include<math.h>
using namespace std;
//Define the function.
float windChillCalculator(float T, float V)
{
//Claculate the wind chill.
float wind_chill=35.74 + 0.6215*T - 35.75*
(float)(pow(V,0.16)) + 0.4275*T*
(float)(pow(V,0.16));
//Return the wind child.
return wind_chill;
}
//Define the main function.
int main()
{
//Declare the variables.
float V, T, wind_chill;
//Prompt the user for input.
cout<<"Enter the air temperature:";
cin>>T;
cout<<endl<<"Enter the wind speed:";
cin>>V;
//Call the windChillCalculator() function
//to retrieve the wind_chill value.
wind_chill = windChillCalculator(T, V);
//Display the results.
cout << "The wind chill is " << wind_chill
<< " degrees F" << " and a wind speed of "
<< V << " mph." << endl;;
return 0;
}
Part B:
Screenshot of the code:
Output:
Code to copy:
//Include the required header file.
#include <iostream>
#include<math.h>
using namespace std;
//Declare the function.
float windChillCalculator(float T, float V);
//Define the function.
void printWindChill()
{
//Declare the variable.
float T, V, low_wind_speed, high_wind_speed,
wind_speed_step, wind_chill;
//Prompt the user for input.
cout << "Enter the air temperature:";
cin >> T;
cout << endl << "Enter the low wind speed:";
cin >> low_wind_speed;
cout << endl << "Enter the high wind speed:";
cin >> high_wind_speed;
cout << endl << "Enter the wind speed step:";
cin >> wind_speed_step;
//Evaluate the iterations.
int n = (high_wind_speed - low_wind_speed) /
wind_speed_step;
V = low_wind_speed;
//Iterate through the loop.
for (int i = 0; i< n + 1; i++)
{
//Call the windChillCalculator() function
//to retrieve the wind_chill value.
wind_chill = windChillCalculator(T, V);
//Display the details.
cout << "The wind chill is " << wind_chill
<< " degrees F for an airtemperature of "
<< T << " degrees F" << " and a wind speed of "
<< V << " mph." << endl;
//Increase the speed.
V = V + wind_speed_step;
}
}
//Define the function.
float windChillCalculator(float T, float V)
{
//Claculate the wind chill.
float wind_chill = 35.74 + 0.6215*T - 35.75*
(float)(pow(V, 0.16)) + 0.4275*T*
(float)(pow(V, 0.16));
//Return the wind child.
return wind_chill;
}
//Define the main function.
int main()
{
//Call the printWindChill() function.
printWindChill();
return 0;
}
Part A Write a function windChillCalculator to determine the wind chill. Your main function should take...
Need to use Python string formatting to align wind-chill values in equal-sized columns Using your knowledge of loops and other Python features covered so far, write a program that prints a table of windchill values, where: Rows represent wind speed for O to 50 in 5 mph increments Columns represent temperatures from -20 to +60 in 10-degree increments Your program should include a function that returns windchill for a given combination of wind speed & temperature, using this formula from...
The formula for wind chill C (in ees Fahrenheit) is given by C-35.74 0.6215T- 35.75v0.16 + 0.42750.16 where v is the wind speed in miles per hour and T is the temperature in degrees Fahrenheit. The wind speed is 27 ± 3 miles per hour and the temperature is 8 1. Use dC to estimate the maximum possible propagated error (round your answer to four decimal places) and relative error in calculating the wind chill (round your answer to two...
Please help in c++, follow the instructions, please. try to use pass by reference and pass by value if you could Description: Write a program that will input wind speed and temperature and output the wind-chill factor. W = 35.74 + 0.6215 ∗ T − 35.75 ∗ V 0.16 + 0.4275 ∗ T ∗ V 0.16 Your program should use at least 2 functions in addition to main. One that uses pass by reference parameters and prompts the user for...
The wind-chill index W is the percelved temperature when the actual temperature is T and the wind speed is v, so we can write W RT, v). Wind speed (km/h) u | 20 | 30 | 40 | 50 | 60 | 70 1018 202 2 2323 -15-24 2627 29 3030 a2030 33-34 3637 44 -2537 3944243 (a) Estimate the values of f(-15, 50) and f/(-15, s0). (Round your answers to two decimal places.) f-15, 50) f-15, so)- What are...
for select part, options are: (Increase, Decrease) Пт, v where w is the win ch index, Tís he adual temperature, and y s the wind speed. A numerical is given in this In this example we considered the function l table. (a) What is the value of f-15, 70)? What is its meaning? f(f-15, 70) which means that if the temperature is -15°C and the wind speed is 70 km/h, then the air would feel equivalent to approximately oC without...
Wind Chill 50 45 40 35 30 Wind Speed (km/h) 25 20 15 10 5 0 in -10 -15 -20 35 40 -45 -50 Air Temperature (°C) Task: The wind chill index measures the sensation of cold on the human skin. In October 2001, Environment Canada introduced the wind chill index above. Each curve represents the combination of air temperature and wind speed that would produce the given wind chill value. For example, a temperature of -25°C and wind speed...
This is for Python3. Why do the answers to these two conditions differ? thank you very much! Wind chill on a windy day, a temperature of 15 degrees may feel colder, perhaps it may feel like 7 degrees The formula below calculates the "wind chill", indicating the temperature that is felt based on the actual temperature (t, in Fahrenheit) and wind speed (v, in miles per hour): - 35.74+0.6215t+(0.4275 t-35.75) (v16 Write a function windChill that takes two input arguments...
The wind-chill index w is the perceived temperature when the actual temperature is T and the wind speed is v, so we can write W-nT, v). Wind speed (km/h) 203040 50 60 70 -10-18-20-2-2-23-23 -15-24-2627293030 20-3033343-36 37 -25 |-37 |-39 |-41 | -42 -43 -44 (a) Estimate the values of ft-15, 50) and (-15, 50). (Round your answers to two decimal places.) -15, 50) 从-15, 50): What are the practical interpretations of these values? by about When the actual temperature...
In C++ Code and Algorithm Please Thanks:) During winter when it is very cold, typically, everyone would like to know the windchill factor, especially, before going out. Meteorologists use the following formula to compute the windchill factor, W: Your program must contain at least two functions: one to get the user input and the other to determine the windchill factor. The main function is not considered to be one of two functions. That function is always included. Also, the functions...
study guide help its three pages 2. The following table given the temperature T in degrees Fahrenheit for a certain after t minutes of cooling in a room. cup of coffee 1 T =minutes 0 10 20 30 40 50 = temperature 115 95 85 77 72 72 a) Write in functional notation the temperature of the cup of coffee after 30 minutes. b) Find the average rate of change of the temperature of the cup of coffee during the...