summaryrefslogtreecommitdiff
path: root/BlankConsoleLab/BlankConsoleLab.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'BlankConsoleLab/BlankConsoleLab.cpp')
-rw-r--r--BlankConsoleLab/BlankConsoleLab.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp
index 0831f32..2637d5f 100644
--- a/BlankConsoleLab/BlankConsoleLab.cpp
+++ b/BlankConsoleLab/BlankConsoleLab.cpp
@@ -16,6 +16,29 @@ int convertC_to_F(int Ctemp)
return Ftemp;
}
+float Wind(float Ftemp)
+{
+ int windspeed;
+ while (true)
+ {
+ string Windspeed;
+
+
+ // take input from the user
+ cout << "Enter a windspeed mph: ";
+ cin >> windspeed;
+ if (windspeed < 0 || windspeed > 231)
+ cout << "windspeed value must be between 0 and 231" << endl;
+ else
+ break;
+
+ } // end windspeed loop
+
+ float windchill = windspeed * 0.7 - Ftemp;
+
+ return windchill;
+}
+
int main()
{
string temptype;
@@ -56,7 +79,10 @@ int main()
} // end F while
}
+ float windchill = Wind(Ftemp);
+ cout << "Windchill: ";
+ cout << windchill;
}