// BlankConsoleLab.cpp : This file contains the 'main' function. Program execution begins and ends there. // Jacob Wilson, cst116, Lab1 #include using namespace std; using std::cout; using std::cin; using std::endl; int main() { float width = 0; float length = 0; float area; float mass; float aspect_ratio; float gravitational_pull; while (true) { cout << "What is the width of the kite in centimeters: "; if (cin >> width && (width >= 1 && width <= 400)) { break; } cout << "Please enter a number between 1 and 400 centimeters." << endl; } while (true) { cout << "What is the length of the kite in centimeters: "; if (cin >> length && (length >= 1 && length <= 400)) { break; } cout << "Please enter a number between 1 and 400 centimeters." << endl; } cout << "\nThe width is " << width << " centimeters and the length is " << length << " centimeters." << endl; area = (length * width) / 2; cout << "The area of the kite is " << area / 10000 << " square meters." << endl << endl; aspect_ratio = width / length; if (aspect_ratio >= 1) cout << "WARNING! Aspect ratio >= 1. Unstable.\n"; else if (aspect_ratio < 1) cout << "Aspect ratio < 1. Good aspect ratio.\n"; mass = 135 * (area / 10000); cout << "\nThe mass of your kite is " << mass << " grams.\n"; gravitational_pull = mass * 9.81; cout << "\nThe gravitational pull of your kite is " << gravitational_pull << " grams * m/s^2\n"; return 0; }