diff options
| -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; |