// BlankConsoleLab.cpp : This file contains the 'main' function. Program execution begins and ends there. //Changes are being made 10/19 for PART 2 #include #include using std::cout; using std::cin; using std::endl; int main() { int width; int length; float areaCM; float areaM; float ratio; float totalMass; float kiteGravPull; //for the input while loops const int botnum = 1; const int topnum = 400; const int FabricWeight = 135; const float pull = 9.8; cout << "Please enter the length of your kite." << endl; cin >> length; //while length is out of bounds while (length < botnum || length > topnum) { cout << "Please enter a value for length between 1 and 400." << endl; cin >> length; } cout << "\nPlease enter the width of your kite." << endl; cin >> width; //while width is out of bounds while (width < botnum || width > topnum) { cout << "Please enter a value for length between 1 and 400." << endl; cin >> width; } cout << "Your kite has a length of: " << length << "cm, and a width of: " << width << "cm." << endl; cout << "\n"; //Mathmatics areaCM = (width * length) / 2; areaM = areaCM / 10000; ratio = (float)width / (float)length; totalMass = (areaM * FabricWeight) / 1000; kiteGravPull = totalMass * pull; //makes sure the floats are printed with 5 decimals cout << std::setprecision(5); cout << std::fixed; cout << "Your kite has an aspect ratio of: " << ratio << endl; cout << "\n"; //Aspect Ratio if statement if (ratio >= 1) { cout << "WARNING: A lower aspect ratio will provide more stability!\n" << endl; } else cout << "Nice aspect ratio!" << endl; //Output cout << "\nYour kite has an area of: " << areaM << " square meters" << endl; cout << "Your kite has an area of: " << areaCM << " square centimeters" << endl; cout << "Your kite is " << totalMass << " grams." << endl; cout << "Your kite has a gravitational pull of: " << kiteGravPull << endl; }