summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--BlankConsoleLab/BlankConsoleLab.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp
index 9824acf..7a99a05 100644
--- a/BlankConsoleLab/BlankConsoleLab.cpp
+++ b/BlankConsoleLab/BlankConsoleLab.cpp
@@ -9,9 +9,32 @@ using std::cout;
using std::cin;
using std::endl;
+const float MASSPERSQUAREMETER = 0.135;
+
int main()
{
float length;
float width;
+ bool leave = false;
+ while (!leave) {
+ cout << "Please enter the length, then width of the kite in centimeters" << endl;
+ cin >> length;
+ cin >> width;
+ if (1 <= width && width <= 400 && 1 <= length && length <= 400) {
+ leave = true;
+ }
+ }
+ float area = (length * width) / 2;
+ area = area / 10000;
+ float aspectratio = width / length;
+ if (aspectratio >= 1) {
+ cout << "Warning: a lower aspect ratio (width / length) will provide more stability" << endl;
+ }
+ float mass = MASSPERSQUAREMETER * area;
+ float gravitationalPull = mass * 9.8;
+
+ cout << "The length of the kite is " << length << "cm." << endl;
+ cout << "The width of the kite is " << width << "cm." << endl;
+ cout << "The area of the kite is " << area << "m^2." << endl;
}