summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--BlankConsoleLab/Lab1-Apetroaei.cpp53
-rw-r--r--Lab1-psuedocode.txt9
2 files changed, 62 insertions, 0 deletions
diff --git a/BlankConsoleLab/Lab1-Apetroaei.cpp b/BlankConsoleLab/Lab1-Apetroaei.cpp
new file mode 100644
index 0000000..1edaa73
--- /dev/null
+++ b/BlankConsoleLab/Lab1-Apetroaei.cpp
@@ -0,0 +1,53 @@
+// CST 116, Lab 1 - Alexandra Apetroaei
+
+
+#include <iostream>
+
+using namespace std;
+
+using std::cout;
+using std::cin;
+using std::endl;
+
+int main()
+{
+ float width;
+ float length;
+ float area;
+ float aspect_ratio;
+ float isStable = false;
+
+ while (isStable == false)
+ {
+ cout << "Insert width (in centimeters): " << endl ;
+ cin >> width;
+
+ cout << "Insert length (in centimeters): " << endl ;
+ cin >> length;
+
+ cout << "You entered: " << width << "cm for width, and " << length << "cm for length" << endl;
+
+ // Area formula
+ area = ((width * length) / 2) / 1000;
+ cout << "The area of the kite is: " << area << "in square meters" << endl;
+
+ aspect_ratio = (width / length);
+
+ if (aspect_ratio >= 1)
+ {
+ cout << "Warning: " << aspect_ratio << "is too high and should be lowered to provie stability! " << endl;
+
+ }
+
+ else
+ {
+ cout << "Aspect ratio:" << aspect_ratio << endl;
+ }
+
+ return 0;
+ }
+
+
+
+}
+
diff --git a/Lab1-psuedocode.txt b/Lab1-psuedocode.txt
new file mode 100644
index 0000000..8e588b6
--- /dev/null
+++ b/Lab1-psuedocode.txt
@@ -0,0 +1,9 @@
+Set width of kite
+Set lenght of kite
+
+Set area formula (Area= width*lenght/2)
+Convert to squarecentimeters (/1000)
+
+
+If greather than or equal to 1 display warning
+Display output to user \ No newline at end of file