summaryrefslogtreecommitdiff
path: root/CST116-lab1-Pseudocode-Crawford.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CST116-lab1-Pseudocode-Crawford.txt')
-rw-r--r--CST116-lab1-Pseudocode-Crawford.txt122
1 files changed, 122 insertions, 0 deletions
diff --git a/CST116-lab1-Pseudocode-Crawford.txt b/CST116-lab1-Pseudocode-Crawford.txt
new file mode 100644
index 0000000..24f51d1
--- /dev/null
+++ b/CST116-lab1-Pseudocode-Crawford.txt
@@ -0,0 +1,122 @@
+CST116 Pseudocode
+// CST116-Week4-Lab1-Kite-Crawford.cpp : This file contains the 'main' function. Program execution begins and ends there.
+//
+PART 1 coding!
+#include <iostream>
+#include <iomanip>
+using std::cout;
+using std::cin;
+using std::endl;
+
+int main()
+{
+ //Part 1 Size
+ float Length = 0;
+ float Width = 0;
+ float Area;
+ float Aspectratio;
+
+ cout << "My Amazing Kite!" << endl;
+ cout << "Please tell me the Length in Centimeters!" << endl;
+ cout << "Enter Kite Height in Centimeters:";
+ cin >> Length;
+
+ cout << "Please tell me the Width in Centimeters!" << endl;
+ cout << "Enter Kite Width in Centimeters:";
+ cin >> Width;
+
+ Area = ((Length * Width) / 2) / 10000;
+ Did the math and conversion in one line for soimplicity.
+
+ cout << Area << endl;
+ cout << "Here is the Area of our Kite in Sq. Meters!" << endl;
+
+ Aspectratio = Width / Length;
+ cout << Aspectratio << endl;
+ cout << "Here is the Aspect Ratio of our Kite" << endl;
+ if (Aspectratio >= 1) {
+ cout << "WARNING!!!! A Lower Aspect Ratio is Advised." << endl;
+ }
+ else if (Aspectratio < 1) {
+ cout << "Good Choice there Partner" << endl;
+ }
+ return 0;
+}
+Part 2 and Final setup of code!
+
+// CST116-Week4-Lab1-Kite-Crawford.cpp : This file contains the 'main' function. Program execution begins and ends there.
+//
+
+#include <iostream>
+#include <iomanip>
+using std::cout;
+using std::cin;
+using std::endl;
+
+
+
+int main()
+{
+ //Part 1 Size
+ float Length = 0;
+ float Width = 0;
+ float Area;
+ float Aspectratio;
+ float Mass;
+ float GravitationalPull;
+ const int GravConst = 6674300;
+ const int EarthMass = 59720000;
+
+ cout << "My Amazing Kite!" << endl;
+ cout << "Please tell me the Length in Centimeters!" << endl;
+ cout << "Enter Kite Height in Centimeters:";
+ cin >> Length;
+ if (Length >= 400|| Length <=1) {
+ cout << "ERROR! Please make Kite withing proper Tolerances" << endl;
+ }
+ else if (Length <= 399||Length >= 2) {
+ cout << "Within Proper Tolerances" << endl;
+ }
+
+ cout << "Please tell me the Width in Centimeters!" << endl;
+ cout << "Enter Kite Width in Centimeters:" << endl;
+ cin >> Width;
+ if (Width >= 400||Width <= 1) {
+ cout << "ERROR! Please make Kite withing proper Tolerances" << endl;
+ }
+ else if (Width <= 399||Width >= 2) {
+ cout << "Within Proper Tolerances" << endl;
+ }
+
+
+ Area = ((Length * Width) / 2) / 10000;
+
+ cout << Area << endl;
+ cout << "Here is the Area of our Kite in Sq. Meters!" << endl;
+
+
+ Aspectratio = Width / Length;
+ cout << Aspectratio << endl;
+ cout << "Here is the Aspect Ratio of our Kite" << endl;
+ if (Aspectratio >= 1) {
+ cout << "WARNING!!!! A Lower Aspect Ratio is Advised." << endl;
+ }
+ else if (Aspectratio < 1) {
+ cout << "Good Choice there Partner" << endl;
+ }
+
+ // Part 2 Can we FLY!
+ Mass = 135 / Area;
+ cout << Mass << endl;
+ cout << "Here is the Mass of our Kite in Kilograms" << endl;
+
+
+ GravitationalPull= GravConst * ((Mass * EarthMass) / 200);
+ cout << "YAY! The kite has a gravitational pull to the Earth of " << GravitationalPull << "Newtons at 200 m in the sky. Congrats on Flight!!" << endl;
+
+ return 0;
+}
+
+I have completed Lab1. It was a major learning expereience with plenty of trial and error problems
+with if statements. With some help from my project partner I got the code to work and show good results.
+If I had more time I would reevaluate the Gravitational pull statement to be a fly or crash scenario. \ No newline at end of file