Question

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.
  • LaTeX: W = 35.74 + 0.6215 * T - 35.75 * V^{0.16} + 0.4275 * T * V^{0.16}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 both temperature (T) and wind speed (V). Another function that calculates and returns the wind chill factor (W).

Sample Run #1 (bold, underlined text is what the user types):

Wind Speed and Temperature? 35 30

Wind Chill Factor = 13.8938
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Thanks for the question.


Below is the code you will be needing Let me know if you have any doubts or if you need anything to change.


=====================================================

#include<iostream>
#include<cmath>

using namespace std;

// returns by value
double calculateWindChill(double speed, double temperature){
  
   return 35.74 + 0.6215*temperature -35.75*pow(speed,0.16)+0.4275*temperature*pow(speed,0.16);
}


// passed by reference
void get_inputs(double &speed, double &temperature){
   cout<<"Wind Speed and Temperature? ";
   cin>>speed;
   cin>>temperature;
}


int main(){
  
   double speed, temperature, wind_chill;
   get_inputs(speed,temperature);

   wind_chill = calculateWindChill(speed,temperature);
   cout<<"Wind Chill Factor = "<<wind_chill<<endl;
}

=======================================================================

C:\Users\User\Documents\wind_chill_f.cpp - [Executing] - Dev-C++ 5.11 File Edit Search View Project Execute Tools AStyle Wind

Please do give upvote please : )

Thank You !!

Add a comment
Know the answer?
Add Answer to:
Please help in c++, follow the instructions, please. try to use pass by reference and pass...
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
  • In C++ Code and Algorithm Please Thanks:) During winter when it is very cold, typically, everyone...

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

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

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

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

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

  • Please help and follow instructions, c++ , let me know if there is any questions Description:...

    Please help and follow instructions, c++ , let me know if there is any questions Description: This program is part 1 of a larger program. Eventually, it will be a complete Flashcard game. For this part, the program will Prompt the user for a file that contains the questions – use getline(cin, fname) instead of cin >> fname to read the file name from the user. This will keep you in sync with the user’s input for later in the...

  • Using C++. Please Provide 4 Test Cases. Test # Valid / Invalid Data Description of test...

    Using C++. Please Provide 4 Test Cases. Test # Valid / Invalid Data Description of test Input Value Actual Output Test Pass / Fail 1 Valid Pass 2 Valid Pass 3 Valid Pass 4 Valid Pass Question 2 Consider a file with the following student information: John Smith 99 Sarah Johnson 85 Jim Robinson 70 Mary Anderson 100 Michael Jackson 92 Each line in the file contains the first name, last name, and test score of a student. Write a...

  • code in C++ Create a program that uses the pass by reference operator instead of the...

    code in C++ Create a program that uses the pass by reference operator instead of the return command. Your main program will need to: create empty variables call void function 1 with no input to display your name to the screen call function 2 to collect the square feet that a gallon of paint covers from user call function 2 to collect the square feet of wall that needs to be painted call function 3 to calculate the number of...

  • Please Help, I will rate either way because of the effort. Description: help in c++, this...

    Please Help, I will rate either way because of the effort. Description: help in c++, this program should have 3 files GuessWho.cpp, Person.cpp, Person.h This program will be a Guess Who game. The program should Read the first line of people.txt, Use the contents to set the members of your Person object, Print the Guess Who People heading, Print the Person that you read earlier Prompt the user for a feature (name, haircolor, hairtype, gender, glasses, eyecolor, or hat) Print...

  • Please write the following code in C++ for Data Structures class. Please follow all the instructions...

    Please write the following code in C++ for Data Structures class. Please follow all the instructions in the picture below. Please write the program with zero warnings. Description: Please write a short program, randomStream, that asks for the name of a file and a number, and produces a files satisfying the following conditions: The file name is the name given by the user (exactly--no added suffixes please) The number of lines in the file is exactly the same as the...

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