summaryrefslogtreecommitdiff
path: root/BlankConsoleLab/BlankConsoleLab.cpp
diff options
context:
space:
mode:
authortwsta <twsta@TRENTON-PC-V2>2022-10-11 20:36:55 -0700
committertwsta <twsta@TRENTON-PC-V2>2022-10-11 20:36:55 -0700
commit2a677a489713318eabb598cc1bee7af3c5b69ca6 (patch)
tree61951c4a8ca70fbe71665ccb21e965b1afbd19df /BlankConsoleLab/BlankConsoleLab.cpp
parentadded checks for too large and too small dimensions (diff)
downloadcst116-lab1-stark-2a677a489713318eabb598cc1bee7af3c5b69ca6.tar.xz
cst116-lab1-stark-2a677a489713318eabb598cc1bee7af3c5b69ca6.zip
added mass calculations and more outputs
Diffstat (limited to 'BlankConsoleLab/BlankConsoleLab.cpp')
-rw-r--r--BlankConsoleLab/BlankConsoleLab.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp
index fca81a9..974c5af 100644
--- a/BlankConsoleLab/BlankConsoleLab.cpp
+++ b/BlankConsoleLab/BlankConsoleLab.cpp
@@ -5,12 +5,13 @@ using namespace std;
int main()
{
int width, length;
- float area, ratio;
+ float area, ratio, mass, force;
+ const float massCon = 135;
cout << "Kite Math 0.2" << endl;
do {
- cout << "Input the width of your kite:" << endl;
+ cout << "Input the width of your kite (1-400 cm):" << endl;
cin >> width;
if (width < 1 || width > 400)
cout << "Input a valid number." << endl;
@@ -18,24 +19,26 @@ int main()
} while (width < 1 || width > 400);
do {
- cout << "Input the length of your kite:" << endl;
+ cout << "Input the length of your kite (1-400 cm):" << endl;
cin >> length;
if (length < 1 || length > 400)
cout << "Input a valid number." << endl;
cout << endl;
} while (length < 1 || length > 400);
- cout << "Width: " << width << endl;
- cout << "length: " << length << endl;
-
area = (width * length) / 2;
area = area / 10000;
ratio = width / length;
+ mass = massCon * area;
+ cout << "Width: " << width << " cm" << endl;
+ cout << "length: " << length << " cm" << endl;
cout << "Ratio: " << ratio << endl;
if (ratio >= 1) {
- cout << "A lower aspect ratio may provide more kit stability" << endl;
+ cout << "A lower aspect ratio may provide more kite stability" << endl;
}
+ cout << "Area: " << area << " m^2" << endl;
+ cout << "Mass: " << mass << " g" << endl;
}