summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjacobdw22 <[email protected]>2022-10-19 22:41:01 -0700
committerjacobdw22 <[email protected]>2022-10-19 22:41:01 -0700
commitb063f3eb13c9d2c2b58da853f7381fea98400833 (patch)
tree18794d60a409866aa67d610d0033481e8a5d11d3
parentsimple changes (diff)
downloadcst116-lab1-jacobdw22-b063f3eb13c9d2c2b58da853f7381fea98400833.tar.xz
cst116-lab1-jacobdw22-b063f3eb13c9d2c2b58da853f7381fea98400833.zip
simple changes
-rw-r--r--BlankConsoleLab/cst116-lab1-wilson.cpp8
-rw-r--r--LabResults.txt4
-rw-r--r--cst116-lab1-wilson-pseudo-code.txt22
3 files changed, 30 insertions, 4 deletions
diff --git a/BlankConsoleLab/cst116-lab1-wilson.cpp b/BlankConsoleLab/cst116-lab1-wilson.cpp
index cc076b2..0811e3f 100644
--- a/BlankConsoleLab/cst116-lab1-wilson.cpp
+++ b/BlankConsoleLab/cst116-lab1-wilson.cpp
@@ -33,19 +33,19 @@ int main()
cout << "Please enter a number between 1 and 400 centimeters." << endl;
}
- cout << "The width is " << width << " centimeters and the length is "
+ cout << "\nThe width is " << width << " centimeters and the length is "
<< length << " centimeters." << endl;
area = (length * width) / 2;
- cout << "The area of the kite is " << area / 10000 << " square meters." << endl;
+ cout << "The area of the kite is " << area / 10000 << " square meters." << endl << endl;
aspect_ratio = width / length;
if (aspect_ratio >= 1)
- cout << "WARNING! Aspect ratio >= 1. Unstable.";
+ cout << "WARNING! Aspect ratio >= 1. Unstable.\n";
else if (aspect_ratio < 1)
- cout << "Aspect ratio < 1. Good aspect ratio.";
+ cout << "Aspect ratio < 1. Good aspect ratio.\n";
diff --git a/LabResults.txt b/LabResults.txt
index 5520ae1..6af62eb 100644
--- a/LabResults.txt
+++ b/LabResults.txt
@@ -1,8 +1,12 @@
--Part 1: Size--
+
What is the width of the kite in centimeters: 15
What is the length of the kite in centimeters: 10
+
The width is 15 centimeters and the length is 10 centimeters.
The area of the kite is 0.0075 square meters.
+
WARNING! Aspect ratio >= 1. Unstable.
--Part 2: Can it fly?--
+
diff --git a/cst116-lab1-wilson-pseudo-code.txt b/cst116-lab1-wilson-pseudo-code.txt
new file mode 100644
index 0000000..cd5e5eb
--- /dev/null
+++ b/cst116-lab1-wilson-pseudo-code.txt
@@ -0,0 +1,22 @@
+Psuedo-Code
+
+DISPLAY "What is the width of the kite in centimeters:";
+READ width
+WHILE width is not between 1 and 400, loop
+ELSE, RUN
+
+DISPLAY "What is the length of the kite in centimeters:";
+READ length;
+WHILE length is not between 1 and 400, loop
+ELSE, RUN
+
+DISPLAY "The width is " width " centimeters and the length is " length " centimeters.";
+
+area = (length * width) / 2;
+
+DISPLAY "The area of the kite is " area / 10000 " square meters."
+
+aspect_ratio = width/length
+
+IF aspect_ratio >= 1, DISPLAY "WARNING! Aspect ratio >= 1. Unstable."
+ELSE, DISPLAY "Aspect ratio < 1. Good aspect ratio." \ No newline at end of file