summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--BlankConsoleLab/BlankConsoleLab.cpp16
-rw-r--r--BlankConsoleLab/BlankConsoleLab.vcxproj10
-rw-r--r--BlankConsoleLab/BlankConsoleLab.vcxproj.filters2
-rw-r--r--BlankConsoleLab/CST116-Lab2-Bold.cpp107
4 files changed, 113 insertions, 22 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp
deleted file mode 100644
index ed5f807..0000000
--- a/BlankConsoleLab/BlankConsoleLab.cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-// BlankConsoleLab.cpp : This file contains the 'main' function. Program execution begins and ends there.
-//
-
-#include <iostream>
-
-using namespace std;
-
-using std::cout;
-using std::cin;
-using std::endl;
-
-int main()
-{
- cout << "Hello World!\n";
-}
-
diff --git a/BlankConsoleLab/BlankConsoleLab.vcxproj b/BlankConsoleLab/BlankConsoleLab.vcxproj
index db2e734..158b739 100644
--- a/BlankConsoleLab/BlankConsoleLab.vcxproj
+++ b/BlankConsoleLab/BlankConsoleLab.vcxproj
@@ -29,26 +29,26 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
- <PlatformToolset>v142</PlatformToolset>
+ <PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
- <PlatformToolset>v142</PlatformToolset>
+ <PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
- <PlatformToolset>v142</PlatformToolset>
+ <PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
- <PlatformToolset>v142</PlatformToolset>
+ <PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
@@ -139,7 +139,7 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
- <ClCompile Include="BlankConsoleLab.cpp" />
+ <ClCompile Include="CST116-Lab2-Bold.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
diff --git a/BlankConsoleLab/BlankConsoleLab.vcxproj.filters b/BlankConsoleLab/BlankConsoleLab.vcxproj.filters
index aca1dd9..75010ea 100644
--- a/BlankConsoleLab/BlankConsoleLab.vcxproj.filters
+++ b/BlankConsoleLab/BlankConsoleLab.vcxproj.filters
@@ -15,7 +15,7 @@
</Filter>
</ItemGroup>
<ItemGroup>
- <ClCompile Include="BlankConsoleLab.cpp">
+ <ClCompile Include="CST116-Lab2-Bold.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
diff --git a/BlankConsoleLab/CST116-Lab2-Bold.cpp b/BlankConsoleLab/CST116-Lab2-Bold.cpp
new file mode 100644
index 0000000..8abed13
--- /dev/null
+++ b/BlankConsoleLab/CST116-Lab2-Bold.cpp
@@ -0,0 +1,107 @@
+#include <iostream>
+#include <fstream>
+#include <iomanip>
+
+using std::cin;
+using std::cout;
+using std::endl;
+
+float Convertor(float&);
+// CtoF - converts temperature in C to F.
+// @param - Celcius is passed by reference.
+float WindChill(float, float);
+// WindChill - calculates the wind chill temp.
+// @param - Fahrenheit is passing by value.
+// @param - wind speed in mph is passing by value.
+
+int main() {
+
+ char option = 0;
+ float tempF = 0;
+ float tempC = 0;
+ float mph = 0;
+ float CtoF = 0;
+ float Fahr = 0;
+
+ while (option != 'f' && option != 'F' && option != 'c' && option != 'C') {
+ cout << "Please enter F for Fahrenheit or C for Celsius: ";
+ cin >> option;
+ }
+
+ if (option == 'f' || option == 'F')
+ {
+ cout << "\n\nPlease enter your temperature between -80 and 121: ";
+ cin >> tempF;
+
+ while (tempF <= -81 || tempF >= 122) {
+ cout << "Enter your temperature between -80 and 121: ";
+ cin >> tempF;
+ }
+
+ tempC = (tempF - 32) * 1.8;
+ cout << "\nYour entry is " << tempF << " Fahrenheit and it is " << tempC << " in Celsius." << "\n\n";
+
+
+ while (mph <= -1 || mph >= 232)
+ {
+ cout << "Now, enter your wind speed in miles between 0 and 231: ";
+ cin >> mph;
+ }
+ cout << "\nYour wind speed is " << mph << " miles per hour!\n\n";
+
+ }
+
+ else if (option == 'c' || option == 'C')
+ {
+ cout << "\n\nPlease enter your tempareture between -62 and 49.5: ";
+ cin >> tempC;
+
+ while (tempC <= -63 || tempC >= 49.6)
+ {
+ cout << "Enter your temperature between -62 and 49.5: ";
+ cin >> tempC;
+ }
+
+ tempF = tempC * 1.8 + 32;
+
+ cout << "\nYour entry is " << tempC << " and it is " << tempF; cout << " Fahrenheit.\n";
+ while (mph <= 0 || mph >= 231)
+ {
+ cout << "\n\nNow, enter your wind speed in miles between 0 and 231: ";
+ cin >> mph;
+ }
+ cout << "\nYour wind speed is " << mph << " miles per hour!\n\n";
+
+ }
+
+
+ float Convertor(tempC);
+
+ float chill = WindChill(tempF, mph);
+
+ cout << "\tFahrenheit\t" << tempF << "\n";
+ cout << "\tCelsius\t\t" << tempC << "\n";
+ cout << "\tWind Speed\t" << mph << "\n";
+ cout << "\tWind Chill\t" << chill << "\n\n";
+
+
+ return 0;
+}
+
+float Convertor(float& tempC)
+{
+ float Fahr = 0;
+
+ Fahr = tempC * 1.8 + 32;
+
+ return 0.0f;
+}
+
+float WindChill(float tempF, float mph)
+{
+ float chill = 0;
+
+ chill = 35.74 + .6215 * (tempF)-35.75 * pow(mph, 0.16) + 0.4275 * (tempF)*pow(mph, 0.16);
+
+ return chill;
+}