diff options
| author | prestonderek <[email protected]> | 2022-10-18 13:44:17 -0700 |
|---|---|---|
| committer | prestonderek <[email protected]> | 2022-10-18 13:44:17 -0700 |
| commit | 168730939c17d7455aa22aa1c4ab045e88e809a5 (patch) | |
| tree | 12c0b09695ce2c42b7ef6feb8e500f5d2daedaee /BlankConsoleLab/BlankConsoleLab.cpp | |
| parent | Setting up GitHub Classroom Feedback (diff) | |
| download | cst116-lab1-prestonderek-168730939c17d7455aa22aa1c4ab045e88e809a5.tar.xz cst116-lab1-prestonderek-168730939c17d7455aa22aa1c4ab045e88e809a5.zip | |
Commit for part 1 complete
Diffstat (limited to 'BlankConsoleLab/BlankConsoleLab.cpp')
| -rw-r--r-- | BlankConsoleLab/BlankConsoleLab.cpp | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp index ed5f807..e80106c 100644 --- a/BlankConsoleLab/BlankConsoleLab.cpp +++ b/BlankConsoleLab/BlankConsoleLab.cpp @@ -3,14 +3,35 @@ #include <iostream> -using namespace std; - using std::cout; using std::cin; using std::endl; int main() { - cout << "Hello World!\n"; + int width; + int length; + float areaCM; + float areaM; + float ratio; + + cout << "Please enter the length of your kite." << endl; + cin >> length; + + cout << "\nPlease enter the width of your kite." << endl; + cin >> width; + cout << "\n"; + + areaCM = (width * length) / 2; + areaM = areaCM / 10000; + ratio = width / length; + + if (ratio >= 1) + { + cout << "WARNING: A lower aspect ratio \nwill provide more stability!\n" << endl; + } + + cout << "Your kite has an area of: " << areaM << " square meters" << endl; + cout << "Your kite has an area of: " << areaCM << " square centimeters" << endl; } |