Question

In C++ Code and Algorithm Please

Thanks:)

  1. 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:
    1. Your program must contain at least two functions: one to get the user input and the other to determine the windchill factor.
    2. The main function is not considered to be one of two functions. That function is always included. Also, the functions must include data being passed to them and if necessary a value returned.
    3. Hint: ideally the function for user input is a void function passing parameters by reference and the windchill function should be a value-returning function.

  2. W = 35.74 + 0.6215*T - 35.75*pow(V, 0.16) + 0.4275*T*pow(V, 0.16);

    where V is the wind speed in miles per hour and T is the temperature in degrees Fahrenheit.

    Write a program that prompts the user to input the wind speed, in miles per hour, and the temperature in degrees Fahrenheit. The program then outputs the windchill factor.

Program Output

Here is a screenshot of the output you should get from your program:

Enter wind speed in miles per hour: 88 Enter temperature in degree Fahrenheit: 11 Current temperature: 11F Windchill factor:

0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include <iostream>

#include <string>

#include <iomanip>

#include <cmath>

using namespace std;

double windChillFactor (const int &v, const int &t)

{

int w = 0;

w = 35.74 + 0.6215*t - 35.75*pow(v, 0.16) + 0.4275*t*pow(v, 0.16);


return w;

}

int main()

{

int v = 0;

int t = 0;

int w = 0;

do

{

cout << "Please enter the wind speed in miles per hour (v): ";

cin >> v;

cout << "Please enter the temperature in degrees Farenheit (t): ";

cin >> t;

} while(v > 3 && t >= 50);

cout << endl << "Current tempurature :"<<t <<"F"<< endl;

w = windChillFactor(v,t);

cout << "WindChill factor: " << w << "F"<< endl;

return 0;

}

----------------------------------------------------------------------------------------------------------------------------------------

output:

#include <string> #include <iomanip> #include <cmath> Please enter the wind speed in miles per hour (v): 88 Please enter the

Add a comment
Know the answer?
Add Answer to:
In C++ Code and Algorithm Please Thanks:) During winter when it is very cold, typically, everyone...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • This is for Python3. Why do the answers to these two conditions differ? thank you very...

    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...

  • Please help in c++, follow the instructions, please. try to use pass by reference and pass...

    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...

  • Need to use Python string formatting to align wind-chill values in equal-sized columns Using your knowledge...

    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 w...

    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...

  • Part​ ​A Write a function windChillCalculator ​to determine the wind chill. Your main function should take...

    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 <<...

  • c programming

    Write a single program to fulfill the following objectives:1) Get the user's name and which place he/she belongs to (use scanf) (2 points)2) Print users name (1 point)3) Print where does the user  belongs to (1 point)4) Obtain temperature (t) in degree Celsius and velocity (v) in m/s from the user (2 points)5) Calculate wind chill factor (wcf) using the following equation. (4 points)w c f = 35.74 + 0.215 t + ( 0.427 t − 35.75 ) v 0.16where t is the temperature in degree Celsius and v is velocity in m/s6) Comments should be...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT