summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonCr <[email protected]>2022-10-21 00:09:05 -0700
committerJonCr <[email protected]>2022-10-21 00:09:05 -0700
commit98b0763518bcdf9bb351a492e99b6fa74d7e23f0 (patch)
tree46fd23b94934caa85f17f4a8925d4e651f6f7edb
parentSetting up GitHub Classroom Feedback (diff)
downloadcst116-lab1-cognitiveshadow-98b0763518bcdf9bb351a492e99b6fa74d7e23f0.tar.xz
cst116-lab1-cognitiveshadow-98b0763518bcdf9bb351a492e99b6fa74d7e23f0.zip
Update
-rw-r--r--BlankConsoleLab/BlankConsoleLab.cpp105
-rw-r--r--BlankConsoleLab/BlankConsoleLab.vcxproj8
2 files changed, 108 insertions, 5 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp
index ed5f807..cec5902 100644
--- a/BlankConsoleLab/BlankConsoleLab.cpp
+++ b/BlankConsoleLab/BlankConsoleLab.cpp
@@ -2,6 +2,7 @@
//
#include <iostream>
+#include <iomanip>
using namespace std;
@@ -9,8 +10,110 @@ using std::cout;
using std::cin;
using std::endl;
+float GetLength();
+float GetWidth();
+//void CalcArea(float length, float width);
+
int main()
{
- cout << "Hello World!\n";
+ float length = 0;
+ float width = 0;
+ float area = 0;
+ float aspectRatio = 0;
+ float mass = 0;
+ const int fabricWeight = 135;
+ float gravitationalPull = 0;
+
+ length = GetLength();
+ width = GetWidth();
+ //CalcArea(length, width);
+
+
+ cout << endl << endl << "Length: " << length << endl;
+ cout << "Width: " << width << endl;
+
+ area = (width * length) / 2;
+ area = area / 10000;
+
+ cout << endl << "The area of you kite is " << area << " square meters." << endl;
+
+
+ aspectRatio = width / length;
+
+ cout << "Your kite's aspect ratio is: " << aspectRatio << endl;
+
+ if (aspectRatio > 1)
+ {
+ cout << endl << "WARNING: Aspect ratio is too high. A lower aspect ratio will provide greater stability. Consider increasing the kite's aspect ratio." << endl;
+ }
+
+ mass = (area * fabricWeight) / 1000;
+
+ cout << endl << "Your kite weighs " << mass << " kg.";
+
+ gravitationalPull = mass * 9.8;
+
+ cout << endl << "The gravitational pull on your kite is " << gravitationalPull << " N/kg" << endl;
+
+ return 0;
}
+float GetLength()
+{
+ float length;
+
+ cout << "Enter kite length in centimeters: ";
+ cin >> length;
+ while (length > 400)
+ {
+ cout << "Length is too large. Must be less than 400." << endl;
+ cout << "Enter kite length in centimeters: ";
+ cin >> length;
+ }
+ while (length < 1)
+ {
+ cout << "Length is too small. Must be greater than 1." << endl;
+ cout << "Enter kite length in centimeters: ";
+ cin >> length;
+ }
+
+ return length;
+}
+float GetWidth()
+{
+ float width;
+
+ cout << "Enter kite width in centimeters: ";
+ cin >> width;
+
+ while (width > 400)
+ {
+ cout << "Width is too large. Must be less than 400." << endl;
+ cout << "Enter kite width in centimeters: ";
+ cin >> width;
+ }
+ while (width < 1)
+ {
+ cout << "Width is too small. Must be greater than 1." << endl;
+ cout << "Enter kite width in centimeters: ";
+ cin >> width;
+ }
+
+ return width;
+}
+/*
+float CalcArea(float length, float width)
+{
+ float area;
+
+ cout << endl << endl << "Length: " << length << endl;
+ cout << "Width: " << width << endl;
+
+ area = (width * length) / 2;
+ area = area / 10000;
+
+ cout << endl << "The area of you kite is " << area << " square meters." << endl;
+
+ return area;
+}
+*/
diff --git a/BlankConsoleLab/BlankConsoleLab.vcxproj b/BlankConsoleLab/BlankConsoleLab.vcxproj
index db2e734..d2e3ee2 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>