From 89c170226a3f568d3cbef5ec75f52f02f1bdba11 Mon Sep 17 00:00:00 2001 From: Tim Pearse Date: Wed, 19 Oct 2022 22:06:04 -0700 Subject: Change 3 : Did everything else --- BlankConsoleLab/BlankConsoleLab.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'BlankConsoleLab/BlankConsoleLab.cpp') 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; } -- cgit v1.2.3