From b5e71ef8aecf73d061c713d8aec363d6094dfbaa Mon Sep 17 00:00:00 2001 From: jacobdw22 Date: Thu, 3 Nov 2022 15:57:07 -0700 Subject: fixed wind chill equation --- BlankConsoleLab/cst116-lab2-wilson.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BlankConsoleLab/cst116-lab2-wilson.cpp b/BlankConsoleLab/cst116-lab2-wilson.cpp index 419835a..c957e32 100644 --- a/BlankConsoleLab/cst116-lab2-wilson.cpp +++ b/BlankConsoleLab/cst116-lab2-wilson.cpp @@ -66,7 +66,7 @@ int main() Loop: //Placeholder to loop back to - cout << "Please enter a temperature between -62 and 49.5 degrees Celsius: \n"; + cout << "Please enter a temperature between -62 and 49.5 degrees Celsius: "; cin >> Celsius; //Reads in Celsius from the user input if (Celsius <= CMAX && Celsius >= CMIN) { @@ -84,9 +84,9 @@ int main() float x = 0.16; - float Chill = 35.74 + 0.6215 * Fahrenheit - 35.75 * (pow(windspeed, x)) + 0.4275 * Fahrenheit * (pow(windspeed, x)); + float Chill = 35.74 + (0.6215 * CtoF(Fahrenheit, Celsius)) - (35.75 * (pow(windspeed, x))) + (0.4275 * CtoF(Fahrenheit, Celsius) * (pow(windspeed, x))); - cout << Chill << endl; + cout << "\tThe wind chill is: " << Chill << endl; } -- cgit v1.2.3