From a714e5261b118d58d745712bebfda4205c51b361 Mon Sep 17 00:00:00 2001 From: Joe Traver Date: Tue, 18 Oct 2022 21:18:35 -0700 Subject: Part 1 Finished. Changed width var to float to accommodate tiny kites that have a ratio of less than 1 to initate the WARNING --- BlankConsoleLab/BlankConsoleLab.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp index 82b9c16..ac5d528 100644 --- a/BlankConsoleLab/BlankConsoleLab.cpp +++ b/BlankConsoleLab/BlankConsoleLab.cpp @@ -12,40 +12,42 @@ using std::endl; int main() { int length; - int width; + float width; float area; float meters; float ratio; cout << "Enter Length of kite in cm: "; - cin >> length; + cin >> length; - cout << "Enter width of kite in cm: "; - cin >> width; + cout << "Enter Width of kite in cm: "; + cin >> width; - cout << "Length = " << length << " cm" << endl; + cout << "Length = " << length << " cm" << endl; + + cout << "Width = " << width << " cm" << endl; + - cout << "Width = " << width << " cm" << endl; - // area calculation - area = (length * width) / 2; + area = (length * width) / 2; // unit conversion - meters = area / 10000; + meters = area / 10000; - cout << "Kite area: " << meters << " square meters" << endl; + cout << "Kite area: " << meters << " square meters" << endl; // aspect ratio - ratio = width / length; + ratio = width / length; if (ratio > 1) - cout << "WARNING! A lower aspect ratio would provide more stability" << endl; + cout << "WARNING! A lower aspect ratio would provide more stability" << endl; return 0; + } -- cgit v1.2.3