diff options
| -rw-r--r-- | BlankConsoleLab/BlankConsoleLab.cpp | 27 | ||||
| -rw-r--r-- | BlankConsoleLab/BlankConsoleLab.vcxproj | 11 | ||||
| -rw-r--r-- | BlankConsoleLab/BlankConsoleLab.vcxproj.filters | 3 | ||||
| -rw-r--r-- | BlankConsoleLab/CST116-Lab1-Pseudocode-Preston.txt | 50 |
4 files changed, 84 insertions, 7 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp index ed5f807..e80106c 100644 --- a/BlankConsoleLab/BlankConsoleLab.cpp +++ b/BlankConsoleLab/BlankConsoleLab.cpp @@ -3,14 +3,35 @@ #include <iostream> -using namespace std; - using std::cout; using std::cin; using std::endl; int main() { - cout << "Hello World!\n"; + int width; + int length; + float areaCM; + float areaM; + float ratio; + + cout << "Please enter the length of your kite." << endl; + cin >> length; + + cout << "\nPlease enter the width of your kite." << endl; + cin >> width; + cout << "\n"; + + areaCM = (width * length) / 2; + areaM = areaCM / 10000; + ratio = width / length; + + if (ratio >= 1) + { + cout << "WARNING: A lower aspect ratio \nwill provide more stability!\n" << endl; + } + + cout << "Your kite has an area of: " << areaM << " square meters" << endl; + cout << "Your kite has an area of: " << areaCM << " square centimeters" << endl; } diff --git a/BlankConsoleLab/BlankConsoleLab.vcxproj b/BlankConsoleLab/BlankConsoleLab.vcxproj index db2e734..579a879 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> @@ -141,6 +141,9 @@ <ItemGroup> <ClCompile Include="BlankConsoleLab.cpp" /> </ItemGroup> + <ItemGroup> + <Text Include="CST116-Lab1-Pseudocode-Preston.txt" /> + </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> </ImportGroup> diff --git a/BlankConsoleLab/BlankConsoleLab.vcxproj.filters b/BlankConsoleLab/BlankConsoleLab.vcxproj.filters index aca1dd9..18518c8 100644 --- a/BlankConsoleLab/BlankConsoleLab.vcxproj.filters +++ b/BlankConsoleLab/BlankConsoleLab.vcxproj.filters @@ -19,4 +19,7 @@ <Filter>Source Files</Filter> </ClCompile> </ItemGroup> + <ItemGroup> + <Text Include="CST116-Lab1-Pseudocode-Preston.txt" /> + </ItemGroup> </Project>
\ No newline at end of file diff --git a/BlankConsoleLab/CST116-Lab1-Pseudocode-Preston.txt b/BlankConsoleLab/CST116-Lab1-Pseudocode-Preston.txt new file mode 100644 index 0000000..c6ab8c4 --- /dev/null +++ b/BlankConsoleLab/CST116-Lab1-Pseudocode-Preston.txt @@ -0,0 +1,50 @@ +Agile notes and Pseudocode for Lab1 + +This program requires the following + +2 inputs: + length of the kite in meters + width of the kite in meters + +Notes: + Ask the user for width and length in cm + Print what the user entered for width and length + Computer the area of the kite using Area=(width x length)/2 + Convert the square cm to square m by dividing by 10000 + Print area in sq m, this uses decimals + computer the aspect ratio of the kite. Aspect ratio is width/length + If the aspect ratio is greater than 1 print a warning to user that a lower ratio would provide more stability. + +Output: + Output is self documenting + Shows input with labels, then the output + + +Pseudocode for part 1: + +int width +int length +float areaCM +float areaM +int ratio + +begin main function + print "enter width of kite" + input width + print "enter length of kite" + input length + print "your kite has a width of: " width " and length of: " length + + areaCM = width x length / 2 + areaM = areaCM / 10000 + ratio = width / length + + if ratio >= 1 + "Warning, a lower aspect ratio would provide more stability" + else + "nice aspect ratio" + + print "your kite's area in square meters is: " areaM + + +
\ No newline at end of file |