summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjacobdw22 <[email protected]>2022-11-03 15:57:07 -0700
committerjacobdw22 <[email protected]>2022-11-03 15:57:07 -0700
commitb5e71ef8aecf73d061c713d8aec363d6094dfbaa (patch)
tree8ac5d912ac10694c8e92dd3bdc2df84fdaeff10a
parentsimple changes (diff)
downloadcst116-lab2-jacobdw22-b5e71ef8aecf73d061c713d8aec363d6094dfbaa.tar.xz
cst116-lab2-jacobdw22-b5e71ef8aecf73d061c713d8aec363d6094dfbaa.zip
fixed wind chill equation
-rw-r--r--BlankConsoleLab/cst116-lab2-wilson.cpp6
1 files 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;
}