summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--BlankConsoleLab/BlankConsoleLab.cpp1
-rw-r--r--CST116-Lab2-Smith-Pseudo-Code.txt24
-rw-r--r--CST116-Lab2-Smith.txt22
3 files changed, 47 insertions, 0 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp
index 8f7b61f..146efa6 100644
--- a/BlankConsoleLab/BlankConsoleLab.cpp
+++ b/BlankConsoleLab/BlankConsoleLab.cpp
@@ -84,5 +84,6 @@ int main()
//Calculate the Wind Chill
wind_chill = Wind_Chill(temperature, wind_speed);
+ //Output Wind Chill
cout << "The wind chill is " << wind_chill<< "." << endl;
} \ No newline at end of file
diff --git a/CST116-Lab2-Smith-Pseudo-Code.txt b/CST116-Lab2-Smith-Pseudo-Code.txt
new file mode 100644
index 0000000..c8c7918
--- /dev/null
+++ b/CST116-Lab2-Smith-Pseudo-Code.txt
@@ -0,0 +1,24 @@
+Temp_Conversion:
+1) Multiply the temperature by 1.8 then add 32
+2) Return the temperature
+
+Temp_Speed_Output:
+1) Output the temperature in Fahrenheit to the user
+2) Output the wind speed to the console
+
+Wind_Chill:
+1) Calculate the wind chill using the temperature and wind speed variables
+2) Return the wind chill value
+
+Main:
+1) Get the input from the user of 'F' for Fahrenheit or 'C' for Celsius
+2) If the input does not match 'F' or 'C' keep asking the user for an input until one of those options is input
+3) If the user's input is 'F' get the value for the temperature between the set const values (-80 to 121)
+4) If the user's input is 'C' get the value for the temperature between the set const values (-61 to 49.5)
+5) While the user's input isn't between the set const values, keep asking until the user inputs a value between the const values
+6) Get the user's input for wind speed between the set const values (0 to 231)
+7) While the user's input isn't between the set const values, keep asking until the user inputs a value between the const values
+8) If the initial user input was 'C' call the Temp_Conversion function using the variable 'temperature'
+9) Call the Temp_Speed_Output function using the variables 'temperature' and 'wind_speed'
+10) Set a variable to be the output of the Wind_Chill function using the variables 'temperature' and 'wind_speed'
+11) Output the wind chill to the console \ No newline at end of file
diff --git a/CST116-Lab2-Smith.txt b/CST116-Lab2-Smith.txt
new file mode 100644
index 0000000..9d86589
--- /dev/null
+++ b/CST116-Lab2-Smith.txt
@@ -0,0 +1,22 @@
+Before you input a temperature value, you must first determine if it's in fahrenheit or celsius.
+Please input 'F' for fahrenheit or 'C' for celsius: cheese
+
+That input is invalid.
+Make sure your input is capitalized.
+Please input 'F' for fahrenheit or 'C' for celsius: C
+
+
+Now please input a temperature between the range -61 to 49.5: -28.889
+
+
+Now please input a wind speed between the range 0 to 231: 30
+
+
+
+The temperature in fahrenheit is -20.0002 degrees.
+The wind speed is 30mph.
+The wind chill is -53.0287.
+
+C:\Users\cowpi\Source\Repos\cst116-lab2-Smith-Benjamin\x64\Debug\BlankConsoleLab.exe (process 17976) exited with code 0.
+To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops.
+Press any key to close this window . . . \ No newline at end of file