// BlankConsoleLab.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include #include using namespace std; using std::cout; using std::cin; using std::endl; float GetLength(); float GetWidth(); //void CalcArea(float length, float width); int main() { float length = 0; float width = 0; float area = 0; float aspectRatio = 0; float mass = 0; const int fabricWeight = 135; float gravitationalPull = 0; length = GetLength(); width = GetWidth(); //CalcArea(length, width); cout << endl << endl << "Length: " << length << endl; cout << "Width: " << width << endl; area = (width * length) / 2; area = area / 10000; cout << endl << "The area of you kite is " << area << " square meters." << endl; aspectRatio = width / length; cout << "Your kite's aspect ratio is: " << aspectRatio << endl; if (aspectRatio > 1) { cout << endl << "WARNING: Aspect ratio is too high. A lower aspect ratio will provide greater stability. Consider increasing the kite's aspect ratio." << endl; } mass = (area * fabricWeight) / 1000; cout << endl << "Your kite weighs " << mass << " kg."; gravitationalPull = mass * 9.8; cout << endl << "The gravitational pull on your kite is " << gravitationalPull << " N/kg" << endl; return 0; } float GetLength() { float length; cout << "Enter kite length in centimeters: "; cin >> length; while (length > 400) { cout << "Length is too large. Must be less than 400." << endl; cout << "Enter kite length in centimeters: "; cin >> length; } while (length < 1) { cout << "Length is too small. Must be greater than 1." << endl; cout << "Enter kite length in centimeters: "; cin >> length; } return length; } float GetWidth() { float width; cout << "Enter kite width in centimeters: "; cin >> width; while (width > 400) { cout << "Width is too large. Must be less than 400." << endl; cout << "Enter kite width in centimeters: "; cin >> width; } while (width < 1) { cout << "Width is too small. Must be greater than 1." << endl; cout << "Enter kite width in centimeters: "; cin >> width; } return width; } /* float CalcArea(float length, float width) { float area; cout << endl << endl << "Length: " << length << endl; cout << "Width: " << width << endl; area = (width * length) / 2; area = area / 10000; cout << endl << "The area of you kite is " << area << " square meters." << endl; return area; } */