diff options
| author | Lloyd Crawford <Lloyd Crawford@LAPTOP-7HJCDLE5> | 2022-10-19 17:24:36 -0700 |
|---|---|---|
| committer | Lloyd Crawford <Lloyd Crawford@LAPTOP-7HJCDLE5> | 2022-10-19 17:24:36 -0700 |
| commit | 6a171f57b6bb1515aafd03f08f43318cb2e50f00 (patch) | |
| tree | 1f6912827478ac12cb456b8148466ef607cdbd09 | |
| parent | Setting up GitHub Classroom Feedback (diff) | |
| download | cst116-lab1-19-ruin-master.tar.xz cst116-lab1-19-ruin-master.zip | |
| -rw-r--r-- | BlankConsoleLab/BlankConsoleLab.cpp | 16 | ||||
| -rw-r--r-- | BlankConsoleLab/BlankConsoleLab.vcxproj | 11 | ||||
| -rw-r--r-- | BlankConsoleLab/BlankConsoleLab.vcxproj.filters | 2 | ||||
| -rw-r--r-- | BlankConsoleLab/CST116-Lab1Kite-Crawford.cpp | 76 | ||||
| -rw-r--r-- | CST116-lab1-Outputs1 and 2-Crawford.txt | 38 | ||||
| -rw-r--r-- | CST116-lab1-Pseudocode-Crawford.txt | 122 |
6 files changed, 243 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..9d9f4be 100644 --- a/BlankConsoleLab/BlankConsoleLab.vcxproj +++ b/BlankConsoleLab/BlankConsoleLab.vcxproj @@ -24,31 +24,32 @@ <ProjectGuid>{3cecade6-3e15-4852-bd24-65bfe5d3a3aa}</ProjectGuid> <RootNamespace>BlankConsoleLab</RootNamespace> <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> + <ProjectName>CST116-Lab1Kite-Crawford</ProjectName> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <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 +140,7 @@ </Link> </ItemDefinitionGroup> <ItemGroup> - <ClCompile Include="BlankConsoleLab.cpp" /> + <ClCompile Include="CST116-Lab1Kite-Crawford.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..1bd8282 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-Lab1Kite-Crawford.cpp"> <Filter>Source Files</Filter> </ClCompile> </ItemGroup> diff --git a/BlankConsoleLab/CST116-Lab1Kite-Crawford.cpp b/BlankConsoleLab/CST116-Lab1Kite-Crawford.cpp new file mode 100644 index 0000000..a26d5c4 --- /dev/null +++ b/BlankConsoleLab/CST116-Lab1Kite-Crawford.cpp @@ -0,0 +1,76 @@ +// CST116-Week4-Lab1-Kite-Crawford.cpp : This file contains the 'main' function. Program execution begins and ends there. +// + +#include <iostream> +#include <iomanip> +using std::cout; +using std::cin; +using std::endl; + + + +int main() +{ + //Part 1 Size + float Length = 0; + float Width = 0; + float Area; + float Aspectratio; + float Mass; + float GravitationalPull; + const int GravConst = 6674300; + const int EarthMass = 59720000; + + cout << "My Amazing Kite!" << endl; + cout << "Please tell me the Length in Centimeters!" << endl; + cout << "Enter Kite Height in Centimeters:"; + cin >> Length; + if (Length >= 400|| Length <=1) { + cout << "ERROR! Please make Kite withing proper Tolerances" << endl; + } + else if (Length <= 399||Length >= 2) { + cout << "Within Proper Tolerances" << endl; + } + + cout << "Please tell me the Width in Centimeters!" << endl; + cout << "Enter Kite Width in Centimeters:" << endl; + cin >> Width; + if (Width >= 400||Width <= 1) { + cout << "ERROR! Please make Kite withing proper Tolerances" << endl; + } + else if (Width <= 399||Width >= 2) { + cout << "Within Proper Tolerances" << endl; + } + + + Area = ((Length * Width) / 2) / 10000; + + cout << Area << endl; + cout << "Here is the Area of our Kite in Sq. Meters!" << endl; + + + Aspectratio = Width / Length; + cout << Aspectratio << endl; + cout << "Here is the Aspect Ratio of our Kite" << endl; + if (Aspectratio >= 1) { + cout << "WARNING!!!! A Lower Aspect Ratio is Advised." << endl; + } + else if (Aspectratio < 1) { + cout << "Good Choice there Partner" << endl; + } + + // Part 2 Can we FLY! + Mass = 135 / Area; + cout << Mass << endl; + cout << "Here is the Mass of our Kite in Kilograms" << endl; + + + GravitationalPull= GravConst * ((Mass * EarthMass) / 200); + cout << "YAY! The kite has a gravitational pull to the Earth of " << GravitationalPull << "Newtons at 200 m in the sky. Congrats on Flight!!" << endl; + + return 0; +} + +//I have completed Lab1. It was a major learning expereience with plenty of trial and error problems +// with if statements.With some help from my project partner I got the code to workand show good results. +//If I had more time I would reevaluate the Gravitational pull statement to be a fly or crash scenario.
\ No newline at end of file diff --git a/CST116-lab1-Outputs1 and 2-Crawford.txt b/CST116-lab1-Outputs1 and 2-Crawford.txt new file mode 100644 index 0000000..45250d6 --- /dev/null +++ b/CST116-lab1-Outputs1 and 2-Crawford.txt @@ -0,0 +1,38 @@ +Here is the output for part 1! + +My Amazing Kite! +Please tell me the Length in Centimeters! +Enter Kite Height in Centimeters:500 +Please tell me the Width in Centimeters! +Enter Kite Width in Centimeters:400 +10 +Here is the Area of our Kite in Sq. Meters! +0.8 +Here is the Aspect Ratio of our Kite +Good Choice there Partner + +C:\Users\Lloyd Crawford\source\repos\cst116-lab1-19-Ruin\x64\Debug\CST116-Lab1Kite-Crawford.exe (process 16556) 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 . . . + +Here is the Output for part 2! +My Amazing Kite! +Please tell me the Length in Centimeters! +Enter Kite Height in Centimeters:300 +Within Proper Tolerances +Please tell me the Width in Centimeters! +Enter Kite Width in Centimeters: +150 +Within Proper Tolerances +2.25 +Here is the Area of our Kite in Sq. Meters! +0.5 +Here is the Aspect Ratio of our Kite +Good Choice there Partner +60 +Here is the Mass of our Kite in Kilograms +YAY! The kite has a gravitational pull to the Earth of 1.19577e+14Newtons at 200 m in the sky. Congrats on Flight!! + +C:\Users\Lloyd Crawford\source\repos\cst116-lab1-19-Ruin\x64\Debug\CST116-Lab1Kite-Crawford.exe (process 26832) 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 diff --git a/CST116-lab1-Pseudocode-Crawford.txt b/CST116-lab1-Pseudocode-Crawford.txt new file mode 100644 index 0000000..24f51d1 --- /dev/null +++ b/CST116-lab1-Pseudocode-Crawford.txt @@ -0,0 +1,122 @@ +CST116 Pseudocode +// CST116-Week4-Lab1-Kite-Crawford.cpp : This file contains the 'main' function. Program execution begins and ends there. +// +PART 1 coding! +#include <iostream> +#include <iomanip> +using std::cout; +using std::cin; +using std::endl; + +int main() +{ + //Part 1 Size + float Length = 0; + float Width = 0; + float Area; + float Aspectratio; + + cout << "My Amazing Kite!" << endl; + cout << "Please tell me the Length in Centimeters!" << endl; + cout << "Enter Kite Height in Centimeters:"; + cin >> Length; + + cout << "Please tell me the Width in Centimeters!" << endl; + cout << "Enter Kite Width in Centimeters:"; + cin >> Width; + + Area = ((Length * Width) / 2) / 10000; + Did the math and conversion in one line for soimplicity. + + cout << Area << endl; + cout << "Here is the Area of our Kite in Sq. Meters!" << endl; + + Aspectratio = Width / Length; + cout << Aspectratio << endl; + cout << "Here is the Aspect Ratio of our Kite" << endl; + if (Aspectratio >= 1) { + cout << "WARNING!!!! A Lower Aspect Ratio is Advised." << endl; + } + else if (Aspectratio < 1) { + cout << "Good Choice there Partner" << endl; + } + return 0; +} +Part 2 and Final setup of code! + +// CST116-Week4-Lab1-Kite-Crawford.cpp : This file contains the 'main' function. Program execution begins and ends there. +// + +#include <iostream> +#include <iomanip> +using std::cout; +using std::cin; +using std::endl; + + + +int main() +{ + //Part 1 Size + float Length = 0; + float Width = 0; + float Area; + float Aspectratio; + float Mass; + float GravitationalPull; + const int GravConst = 6674300; + const int EarthMass = 59720000; + + cout << "My Amazing Kite!" << endl; + cout << "Please tell me the Length in Centimeters!" << endl; + cout << "Enter Kite Height in Centimeters:"; + cin >> Length; + if (Length >= 400|| Length <=1) { + cout << "ERROR! Please make Kite withing proper Tolerances" << endl; + } + else if (Length <= 399||Length >= 2) { + cout << "Within Proper Tolerances" << endl; + } + + cout << "Please tell me the Width in Centimeters!" << endl; + cout << "Enter Kite Width in Centimeters:" << endl; + cin >> Width; + if (Width >= 400||Width <= 1) { + cout << "ERROR! Please make Kite withing proper Tolerances" << endl; + } + else if (Width <= 399||Width >= 2) { + cout << "Within Proper Tolerances" << endl; + } + + + Area = ((Length * Width) / 2) / 10000; + + cout << Area << endl; + cout << "Here is the Area of our Kite in Sq. Meters!" << endl; + + + Aspectratio = Width / Length; + cout << Aspectratio << endl; + cout << "Here is the Aspect Ratio of our Kite" << endl; + if (Aspectratio >= 1) { + cout << "WARNING!!!! A Lower Aspect Ratio is Advised." << endl; + } + else if (Aspectratio < 1) { + cout << "Good Choice there Partner" << endl; + } + + // Part 2 Can we FLY! + Mass = 135 / Area; + cout << Mass << endl; + cout << "Here is the Mass of our Kite in Kilograms" << endl; + + + GravitationalPull= GravConst * ((Mass * EarthMass) / 200); + cout << "YAY! The kite has a gravitational pull to the Earth of " << GravitationalPull << "Newtons at 200 m in the sky. Congrats on Flight!!" << endl; + + return 0; +} + +I have completed Lab1. It was a major learning expereience with plenty of trial and error problems +with if statements. With some help from my project partner I got the code to work and show good results. +If I had more time I would reevaluate the Gravitational pull statement to be a fly or crash scenario.
\ No newline at end of file |