diff options
| author | Joe Traver <[email protected]> | 2022-10-19 22:33:08 -0700 |
|---|---|---|
| committer | Joe Traver <[email protected]> | 2022-10-19 22:33:08 -0700 |
| commit | 3009c0d82ce189e3e67cb09f57190fddcdc5bf58 (patch) | |
| tree | 1e55d9ead6f5f7453b7decaff4e255d1e99ada92 | |
| parent | Adjust end calculations and streamine (diff) | |
| download | cst116-lab1-joetraver30-3009c0d82ce189e3e67cb09f57190fddcdc5bf58.tar.xz cst116-lab1-joetraver30-3009c0d82ce189e3e67cb09f57190fddcdc5bf58.zip | |
Added Pseudo Code
| -rw-r--r-- | BlankConsoleLab/BlankConsoleLab.cpp | 6 | ||||
| -rw-r--r-- | BlankConsoleLab/Pseudo Code.txt | 71 |
2 files changed, 74 insertions, 3 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp index 85c6c8d..d08fb77 100644 --- a/BlankConsoleLab/BlankConsoleLab.cpp +++ b/BlankConsoleLab/BlankConsoleLab.cpp @@ -24,10 +24,10 @@ int main() do { - cout << "Enter Length of kite in cm: "; + cout << "Enter length of kite in cm: "; cin >> length; - cout << "Enter Width of kite in cm: "; + cout << "Enter width of kite in cm: "; cin >> width; @@ -44,7 +44,7 @@ int main() // unit conversion area_m = area_cm / 10000; - cout << "Kite area: " << area_m << " square meters" << endl; + cout << "Kite area = " << area_m << " square meters" << endl; // aspect ratio ratio = width / length; diff --git a/BlankConsoleLab/Pseudo Code.txt b/BlankConsoleLab/Pseudo Code.txt new file mode 100644 index 0000000..fa1f603 --- /dev/null +++ b/BlankConsoleLab/Pseudo Code.txt @@ -0,0 +1,71 @@ +// establish variables + int length; + float width; + float area_cm; + float area_m; + float ratio; + int grav = 9.81; + int weight = 135; + float grav_pull; + float masskg; + +// loop to prevent values that are < 1 or > 400 + -do + User input values + + print: + Enter length of kite in cm: + input_var length + + Enter width of kite in cm: + input_var width + + Feedback of values + + print: + Length = output_var length + + Width = output_var width + + -while condition + + 1 < length < 400 + 1 < width < 400 + +// calculations + + -area + area_cm = (length * width) / 2 + + -Unit conversion + area_m = area_cm /10000 + + -aspect ratio + ratio = width / length + + -mass + masskg = (area_m * weight) / 1000 + + -gravitational pull + grav_pull = masskg* grav + +// calculation outputs + + -kite in meters + print: + kite area = 'area_m' square meters + + -aspect ratio + if ratio > 1 + print: + WARNING! A lower aspect ratio would provide more stability + + -total mass + print: + Total mass of the kite is: 'masskg' Kg + + -gravitational pull + print: + Gravitational pull applied to the kite is: 'grav_pull' Newtons + + |