diff options
| -rw-r--r-- | BlankConsoleLab/BlankConsoleLab.cpp | 26 |
1 files 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; + } |