#include using namespace std; using std::cout; using std::cin; using std::endl; int main() { float width = 0; float length = 0; float area = 0; float aspect_ratio = 0; const float fabric = 135; // 135 gram per meter float grav = 0; // gravitation while (width < 1 || width > 400) //I used while for the range of 1 to 400 { cout << "Enter the width in centimeters between 1 and 400 : "; cin >> width; } while (length < 1 || length > 400) //I used while for the length range as well. It will loop untill correct number entered. { cout << "Enter the length in centimeters between 1 and 400 : "; cin >> length; } cout << "\n\nYour width is " << width << " and " << "length is " << length << " centimeters.\n\n"; area = (((width * length) / 2) / 10000); //Calculating total area here. grav = area * fabric; //Calculating gravitational pull. aspect_ratio = width / length; //Calcualting the aspect of ratio cout << "Total area: " << area << " square meters." <<"\nGravitational pull: " << grav <<" gr.\n"; cout << "The aspect ratio: " << aspect_ratio; if (aspect_ratio >= 1) // I used if statement cout << "\nA lower aspect ratio provides more stability. \n\n"; else cout << "\nThe aspect of ratio is good. \n\n"; return 0; }