diff options
| author | Tim Pearse <[email protected]> | 2022-10-19 22:06:04 -0700 |
|---|---|---|
| committer | Tim Pearse <[email protected]> | 2022-10-19 22:06:04 -0700 |
| commit | 89c170226a3f568d3cbef5ec75f52f02f1bdba11 (patch) | |
| tree | 66e0659b928a98e6757e0160d6a01e5c28af05b5 /BlankConsoleLab/BlankConsoleLab.cpp | |
| parent | Change 2 : Created length and width variables. (diff) | |
| download | cst116-lab1-legokid1503-89c170226a3f568d3cbef5ec75f52f02f1bdba11.tar.xz cst116-lab1-legokid1503-89c170226a3f568d3cbef5ec75f52f02f1bdba11.zip | |
Change 3 : Did everything else
Diffstat (limited to 'BlankConsoleLab/BlankConsoleLab.cpp')
| -rw-r--r-- | BlankConsoleLab/BlankConsoleLab.cpp | 23 |
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; } |