diff options
| author | tafaar <[email protected]> | 2022-11-08 17:49:17 -0800 |
|---|---|---|
| committer | tafaar <[email protected]> | 2022-11-08 17:49:17 -0800 |
| commit | 84a896a8a6312e52d5b3e97364953422a2765daf (patch) | |
| tree | 95315c17b000f27dacfccca8b1d5dde5c9450d0c | |
| parent | created calculate windchill function (diff) | |
| download | cst116-lab2-hill-84a896a8a6312e52d5b3e97364953422a2765daf.tar.xz cst116-lab2-hill-84a896a8a6312e52d5b3e97364953422a2765daf.zip | |
added variables
| -rw-r--r-- | BlankConsoleLab/BlankConsoleLab.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp index fd50cc8..5058631 100644 --- a/BlankConsoleLab/BlankConsoleLab.cpp +++ b/BlankConsoleLab/BlankConsoleLab.cpp @@ -8,8 +8,8 @@ using namespace std; -float tempCelsius; -float tempFahrenheit; +float tempCelsius, windCelsius; +float tempFahrenheit, windFahrenheit; float windSpeed; const float minF = -80.0, maxF = 121.0, minC = -62.0, maxC = 49.5; @@ -51,7 +51,7 @@ bool CheckWindSpeed(float& input) { float CalculateWindChill(float fahrenheit, float speed) { - + 35.74 + (0.6215 * tempFahrenheit) + (pow(windSpeed, 0.16) * ((0.4275 * tempFahrenheit) - 35.75)); } @@ -119,7 +119,7 @@ int main() int colWidth = 20; - float windChill = 35.74 + (0.6215 * tempFahrenheit) + (pow(windSpeed, 0.16) * ((0.4275 * tempFahrenheit) - 35.75)); + float windChill; cout << "\nConversions for " << tempInput << tempSystem << " with wind speed " << windSpeed << "MPH." << endl; |