summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortwsta <twsta@TRENTON-PC-V2>2022-10-11 20:44:34 -0700
committertwsta <twsta@TRENTON-PC-V2>2022-10-11 20:44:34 -0700
commit47911689983162789f0dbec4d02d72b54d313995 (patch)
tree2abafd67d396e12e595098bae0feaa3369014b01
parentadded mass calculations and more outputs (diff)
downloadcst116-lab1-stark-47911689983162789f0dbec4d02d72b54d313995.tar.xz
cst116-lab1-stark-47911689983162789f0dbec4d02d72b54d313995.zip
added comments
-rw-r--r--BlankConsoleLab/BlankConsoleLab.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp
index 974c5af..bc9af16 100644
--- a/BlankConsoleLab/BlankConsoleLab.cpp
+++ b/BlankConsoleLab/BlankConsoleLab.cpp
@@ -10,6 +10,7 @@ int main()
cout << "Kite Math 0.2" << endl;
+ //input
do {
cout << "Input the width of your kite (1-400 cm):" << endl;
cin >> width;
@@ -26,12 +27,13 @@ int main()
cout << endl;
} while (length < 1 || length > 400);
-
- area = (width * length) / 2;
- area = area / 10000;
+ //calculations
+ area = ((width * length) / 2) / 10000;
ratio = width / length;
mass = massCon * area;
+ force = (mass / 1000) * 9.8;
+ //outputs
cout << "Width: " << width << " cm" << endl;
cout << "length: " << length << " cm" << endl;
cout << "Ratio: " << ratio << endl;
@@ -40,5 +42,6 @@ int main()
}
cout << "Area: " << area << " m^2" << endl;
cout << "Mass: " << mass << " g" << endl;
+ cout << "Force of gravity: " << force << " N" << endl;
}