Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- //Function prototypes
- float userInput();
- float windChill(float W, float T, float V);
- void header();
- //Function userInput
- //This function takes the input from the user
- float userInput()
- {
- float W = 0, T = 0, V = 0;
- cout << "Please input the windspeed: ";
- cin >> V;
- cout << "Please input the temperature: ";
- cin >> T;
- }
- int main()
- {
- cout << "The windchill factor is: " << windChill(W) << endl;
- return 0;
- }
- //Function header
- //This function outputs basic info to the user
- void header()
- {
- cout << "Written by Andrew Brucks" << endl;
- cout << "Lab 6 Part 3" << endl;
- cout << "This program will analyze the input and output the windchill\n\n" << endl;
- }
- //Function windChill
- //This function takes the inputted data and calculates the windchill
- float windChill(float W, float T, float V)
- {
- W = 35.74 + 0.6215 * T - 35.75 * pow(V, 0.16) + 0.4275 * T * pow(V, 0.16);
- return W;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement