From 1b5b3acc07d9fbcddf49e26125e456dea37ca434 Mon Sep 17 00:00:00 2001 From: Musa Ahmed Date: Wed, 19 Oct 2022 17:24:05 -0700 Subject: Added Pseudocode --- cst116-lab1-Ahmed/cst116-lab1-Ahmed-pseudocode.txt | 27 +++++++++++++++++++ cst116-lab1-Ahmed/cst116-lab1-Ahmed.sln | 31 ++++++++++++++++++++++ cst116-lab1-Ahmed/cst116-lab1-Ahmed.vcxproj | 3 +++ .../cst116-lab1-Ahmed.vcxproj.filters | 5 ++++ 4 files changed, 66 insertions(+) create mode 100644 cst116-lab1-Ahmed/cst116-lab1-Ahmed-pseudocode.txt create mode 100644 cst116-lab1-Ahmed/cst116-lab1-Ahmed.sln diff --git a/cst116-lab1-Ahmed/cst116-lab1-Ahmed-pseudocode.txt b/cst116-lab1-Ahmed/cst116-lab1-Ahmed-pseudocode.txt new file mode 100644 index 0000000..eec44ae --- /dev/null +++ b/cst116-lab1-Ahmed/cst116-lab1-Ahmed-pseudocode.txt @@ -0,0 +1,27 @@ +Start program + +Initialize width, length, area, mass, aspect_ratio, and grav_pull as floats +Initialize isStable, and range as booleans set to false + +Start a while loop which will loop until isStable is true + + Nest another while loop inside the previous one, which will loop until range is true + Ask the user for the width and length and store them into their respective variables + If the width or length is greater than 400 or less than 1 + Prompt the user to enter a width between 1 and 400 + Otherwise range is set to true and break from the while loop + + Output the width and length for th euser to see + Compute the area by multiplying width and length, dividing the answer by 2, and converting to square meters by dividing by 10000 store in area + Output the area + Compute the aspect ration by dividing the width and length + Compute the mass by multiplying the area by the fabric weight per square meter and converting to kg by dividing by 1000 store in mass + output the mass + compute the gravitational pull by multiplying the variable mass by 9.8 and store in grav_pull + + If the aspect reatio is greater than 1 + Prompt the user with a warning, telling them that the kite will be instable and print aspect ratio + set range to false + Otherwise print the aspect ratio and break from the while loop + +End program \ No newline at end of file diff --git a/cst116-lab1-Ahmed/cst116-lab1-Ahmed.sln b/cst116-lab1-Ahmed/cst116-lab1-Ahmed.sln new file mode 100644 index 0000000..4931d3a --- /dev/null +++ b/cst116-lab1-Ahmed/cst116-lab1-Ahmed.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.3.32929.385 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cst116-lab1-Ahmed", "cst116-lab1-Ahmed.vcxproj", "{3CECADE6-3E15-4852-BD24-65BFE5D3A3AA}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3CECADE6-3E15-4852-BD24-65BFE5D3A3AA}.Debug|x64.ActiveCfg = Debug|x64 + {3CECADE6-3E15-4852-BD24-65BFE5D3A3AA}.Debug|x64.Build.0 = Debug|x64 + {3CECADE6-3E15-4852-BD24-65BFE5D3A3AA}.Debug|x86.ActiveCfg = Debug|Win32 + {3CECADE6-3E15-4852-BD24-65BFE5D3A3AA}.Debug|x86.Build.0 = Debug|Win32 + {3CECADE6-3E15-4852-BD24-65BFE5D3A3AA}.Release|x64.ActiveCfg = Release|x64 + {3CECADE6-3E15-4852-BD24-65BFE5D3A3AA}.Release|x64.Build.0 = Release|x64 + {3CECADE6-3E15-4852-BD24-65BFE5D3A3AA}.Release|x86.ActiveCfg = Release|Win32 + {3CECADE6-3E15-4852-BD24-65BFE5D3A3AA}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {E9C10A59-9BDA-45B9-9318-BB11C65248CA} + EndGlobalSection +EndGlobal diff --git a/cst116-lab1-Ahmed/cst116-lab1-Ahmed.vcxproj b/cst116-lab1-Ahmed/cst116-lab1-Ahmed.vcxproj index dc183f2..2cfcbb5 100644 --- a/cst116-lab1-Ahmed/cst116-lab1-Ahmed.vcxproj +++ b/cst116-lab1-Ahmed/cst116-lab1-Ahmed.vcxproj @@ -141,6 +141,9 @@ + + + diff --git a/cst116-lab1-Ahmed/cst116-lab1-Ahmed.vcxproj.filters b/cst116-lab1-Ahmed/cst116-lab1-Ahmed.vcxproj.filters index 61722a1..8a2983d 100644 --- a/cst116-lab1-Ahmed/cst116-lab1-Ahmed.vcxproj.filters +++ b/cst116-lab1-Ahmed/cst116-lab1-Ahmed.vcxproj.filters @@ -19,4 +19,9 @@ Source Files + + + Source Files + + \ No newline at end of file -- cgit v1.2.3