diff options
| author | Nathanturcas <[email protected]> | 2022-11-09 19:31:02 -0800 |
|---|---|---|
| committer | Nathanturcas <[email protected]> | 2022-11-09 19:31:02 -0800 |
| commit | 330a1faab781d78cdd190985c35f11f88fe2e35b (patch) | |
| tree | 6908c4769ee00cef4e085e027956002247fba85e /BlankConsoleLab/BlankConsoleLab.cpp | |
| parent | commit 1 (diff) | |
| download | cst116-lab2-nathanturcas-330a1faab781d78cdd190985c35f11f88fe2e35b.tar.xz cst116-lab2-nathanturcas-330a1faab781d78cdd190985c35f11f88fe2e35b.zip | |
commit 2
Diffstat (limited to 'BlankConsoleLab/BlankConsoleLab.cpp')
| -rw-r--r-- | BlankConsoleLab/BlankConsoleLab.cpp | 26 |
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; } |