diff options
| author | Trevor Bouchillon <[email protected]> | 2022-11-09 12:45:18 -0800 |
|---|---|---|
| committer | Trevor Bouchillon <[email protected]> | 2022-11-09 12:45:18 -0800 |
| commit | 9da99678fefd622ad122151e08d2f50a5ef569c1 (patch) | |
| tree | 94900826b4862d8a57aa5bb1a544b1c0b85be71d /BlankConsoleLab/BlankConsoleLab.cpp | |
| parent | Finished Code (diff) | |
| download | cst116-lab2-daboochillin-9da99678fefd622ad122151e08d2f50a5ef569c1.tar.xz cst116-lab2-daboochillin-9da99678fefd622ad122151e08d2f50a5ef569c1.zip | |
added notes
Diffstat (limited to 'BlankConsoleLab/BlankConsoleLab.cpp')
| -rw-r--r-- | BlankConsoleLab/BlankConsoleLab.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp index 085e6f1..b3d9a59 100644 --- a/BlankConsoleLab/BlankConsoleLab.cpp +++ b/BlankConsoleLab/BlankConsoleLab.cpp @@ -1,4 +1,7 @@ -// BlankConsoleLab.cpp : This file contains the 'main' function. Program execution begins and ends there. +// +// Lab2 +// Trevor Bouchillon +// CST116 // #include <iostream> @@ -18,12 +21,12 @@ char CorF; float windchill; -float CelciusToFarenheit(float Celcius2Farenheit) { +float CelciusToFarenheit(float Celcius2Farenheit) { //function to turn celcius entries into farenheit. Celcius2Farenheit = (UserInputTemp * (static_cast<float>(9) / 5)) + 32; return Celcius2Farenheit; } - -float GetTemp() { + +float GetTemp() { //function to collect temperature inputs cout << "Please enter a temperature in Celcius or Farenheit: "; cin >> UserInputTemp; cout << "If you entered a temperature in Celcius please enter 'C' and if you entered a temperature in Farenheit please enter 'F'. "; @@ -51,7 +54,7 @@ float GetTemp() { return UserInputTemp; } -float GetWindSpeed() { +float GetWindSpeed() { //function to collect windspeed inputs cout << "Please enter a wind speed in Miles Per Hour: "; cin >> WindSpeed; while (WindSpeed < 0 || WindSpeed > 231) { @@ -62,7 +65,7 @@ float GetWindSpeed() { return WindSpeed; } -float WindChill() { +float WindChill() { //function to calculate windchill windchill = 35.74 + (0.6215 * CelciusToFarenheit(UserInputTemp)) - (35.75 * pow(WindSpeed, 0.16)) + (0.4275 * CelciusToFarenheit(UserInputTemp) * pow(WindSpeed, 0.16)); cout << "Based on your inputs of " << CelciusToFarenheit(UserInputTemp) << " and " << WindSpeed << ", the wind chill is " << windchill << "."; return windchill; |