summaryrefslogtreecommitdiff
path: root/BlankConsoleLab
diff options
context:
space:
mode:
authorDoolyBoi <[email protected]>2022-11-09 21:11:01 -0800
committerDoolyBoi <[email protected]>2022-11-09 21:11:01 -0800
commit47999da32e2ea8b803f2baeb5d7c775337d44a33 (patch)
treeff0ea0e6901f0d48ff58a90478037bb4369d7a23 /BlankConsoleLab
parentmade function work (diff)
downloadcst116-lab2-abd00l4h-47999da32e2ea8b803f2baeb5d7c775337d44a33.tar.xz
cst116-lab2-abd00l4h-47999da32e2ea8b803f2baeb5d7c775337d44a33.zip
comments
Diffstat (limited to 'BlankConsoleLab')
-rw-r--r--BlankConsoleLab/BlankConsoleLab.cpp27
1 files changed, 24 insertions, 3 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp
index 3acc188..a72039e 100644
--- a/BlankConsoleLab/BlankConsoleLab.cpp
+++ b/BlankConsoleLab/BlankConsoleLab.cpp
@@ -20,7 +20,12 @@ const float CM = 49.5;
const float Wm = 0;
const float WM = 231;
-//Takes celcius and converts it to fahrenhiet
+/*
+Function: C_to_F
+Input: Celcius(float)
+Return: Fahrenheit(float)
+Purpose: Converts celius to fahrenheit
+*/
float C_to_F(float x)
{
x *= 1.8;
@@ -28,7 +33,12 @@ float C_to_F(float x)
return x;
}
-//Asks user for the "value" of "type" which has to be between "min" and "max"
+/*
+Function: GetUserInputs
+Input: variable(float), min value(float) max value(float), variable's type(string)
+Return: None
+Purpose: Ask user for the value of type between min and max
+*/
void getUserInputs(float& value, float min, float max, string type)
{
while (value <= min || value >= max)
@@ -39,12 +49,23 @@ void getUserInputs(float& value, float min, float max, string type)
}
}
-//calculates the wind chill and returns it
+/*
+Function: calculate
+Input: MPH(float), degrees F(float)
+Return: Wind Chill(float)
+Purpose: To calculate wind chill from wind speed and temperature
+*/
float calculate(float mph, float degrees)
{
return (35.74 + (0.6215 * degrees) - (35.75 * pow(mph, 0.16)) + (0.4275 * degrees * pow(mph, 0.16)));
}
+/*
+Function: main()
+Input:None
+Return:None
+Purpose: Ask user what degree they will enter temp in and run functions based off that
+*/
int main()
{
string CorF;