diff options
| author | tafaar <[email protected]> | 2022-10-16 00:20:44 -0700 |
|---|---|---|
| committer | tafaar <[email protected]> | 2022-10-16 00:20:44 -0700 |
| commit | a4f9a187c793ea54fcf41f2ac787c8a584f8a9f6 (patch) | |
| tree | 0d309a5f77150c9120c0fcedb51bd50889d7387c /BlankConsoleLab/BlankConsoleLab.cpp | |
| parent | added a warning (diff) | |
| download | cst116-lab1-hill-a4f9a187c793ea54fcf41f2ac787c8a584f8a9f6.tar.xz cst116-lab1-hill-a4f9a187c793ea54fcf41f2ac787c8a584f8a9f6.zip | |
some formatting, added the flowchart. finished
Diffstat (limited to 'BlankConsoleLab/BlankConsoleLab.cpp')
| -rw-r--r-- | BlankConsoleLab/BlankConsoleLab.cpp | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp deleted file mode 100644 index bc4bf7c..0000000 --- a/BlankConsoleLab/BlankConsoleLab.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include <iostream> - -using std::cout; -using std::cin; -using std::endl; - -float width; -float length; - - -int main() -{ - cout << std::fixed; - cout.precision(3); - - cout << "Please enter the width of your kite in centimeters. Use values between 1 - 400 cm." << endl; - - do { - - cin >> width; - if (width < 1 || width > 400) cout << "Please try again with a value between 1 - 400" << endl; - - } while ( width > 400 || width < 1); - - cout << "Now enter the length, again between 1 - 400cm." << endl; - - do { - - cin >> length; - if (length < 1 || length > 400) cout << "Please try again with a value between 1 - 400" << endl; - - } while (length > 400 || length < 1); - - cout << endl << "The dimensions of your kite are " << width << "cm by " << length << "cm." << endl; - - double area = (width * length) / 10000.0; - float aspectRatio = width / length; - - cout << "The area is " << area << " square meters." << endl; - cout << "The aspect ratio is " << width / length << endl; - - if (aspectRatio >= 1) { - cout << endl << "WARNING: A lower aspect ratio might provide better stability." << endl; - } - - const float mass = 135.0f * area; - - cout << endl << "Your kite has a mass of " << mass << " grams."; - -} - |