Answer to Question #183013 in C++ for Vincenzo Santoro

Question #183013

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:

W = 35.74 + 0.6215 × T - 35.75 × V0.16 + 0.4275 × T × V0.16

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

Instructions

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 current temperature and the windchill factor. Your program must contain at least two functions: one to get the user input and the other to determine the windchill factor.


1
Expert's answer
2021-04-28T02:48:51-0400
#include <iostream>
#include <cmath>
 
using namespace std;
 
void Input();
double Wind(double T, double V);
 
int main()
{
	Input();
	return 0;
}
 
void Input()
{
	double T;
	double V;
	cout << "Enter temperature: ";
	cin >> T;
	cout << "Enter speed in miles per our: ";
	cin >> V;
	Wind(T, V);
}
 
double Wind(double T, double V)
{
	double windchill = 35.74 + 0.6215 * T - 35.75 * pow(V, 0.16) + 0.4275 * T * pow(V, 0.16);
	cout << "Temperature is: " << T << " and windchill factor is: " << windchill << endl;;
	return windchill;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS