diff options
| author | Andrei F <[email protected]> | 2022-10-19 21:49:32 -0700 |
|---|---|---|
| committer | Andrei F <[email protected]> | 2022-10-19 21:49:32 -0700 |
| commit | 9e45c680b04605f05364fcf2ffb2a01df8c1b3ca (patch) | |
| tree | d4f8371c7ba7c081808e608de05f48386f2f7e01 | |
| parent | Correctly named files (diff) | |
| download | cst116-lab1-florea-9e45c680b04605f05364fcf2ffb2a01df8c1b3ca.tar.xz cst116-lab1-florea-9e45c680b04605f05364fcf2ffb2a01df8c1b3ca.zip | |
Added comments
| -rw-r--r-- | BlankConsoleLab/CST-116-Project1-Florea.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/BlankConsoleLab/CST-116-Project1-Florea.cpp b/BlankConsoleLab/CST-116-Project1-Florea.cpp index 29fa885..df81f12 100644 --- a/BlankConsoleLab/CST-116-Project1-Florea.cpp +++ b/BlankConsoleLab/CST-116-Project1-Florea.cpp @@ -21,6 +21,8 @@ int main() float length = 0; float area, ratio; + // This will take in input for width and length in the range of 1, 400 inclusive. If it's outside the range, + // then the loop will repeat until given the correct values. while(!(width <= 400 && width >= 1 && length <= 400 && length >= 1)) { cout << "Please only enter WIDTH and LENGTH between 1 - 400" << endl; @@ -33,17 +35,16 @@ int main() cout << "Width: " << width << " CM" <<" | Length: " << length << " CM" << endl; area = (width * length) / 2; - area /= 10000; - + area /= 10000; // Converts the area from square centimeters to square meters cout << "Area (in square meters): " << area << " M^2" << endl; - const float mass = 135 * area; + const float mass = 135 * area; // Finds the total mass of the kite. cout << "If your kite is using a medium weight fabric, it is calculated to weigh: " << mass << " grams/meter^2" << endl; - ratio = width / length; + ratio = width / length; // Finds aspect ratio of kite if(ratio >= 1){ cout << "Warning: a lower aspect ratio would provide more stability." << endl; cout << "Current aspect ratio: " << ratio << " (width / length)"<< endl; |