/* * BlankConsoleLab.cpp : This file contains the 'main' function.Program execution begins and ends there. * * Morgan Cyrus * CST116_Lab1_Cyrus * Kite Lab * * Note: This has been put in order of completion. Do one step and then compile / check it. * * Ask the user for the width and length in centimeters. * Print what the user entered for the width and length. * Compute the area of the kite. Area = (width × length)/ 2 * Convert the square centimeters to square meters by dividing by 10000. * Print area in square meters. Note: square meters will use decimals. * Compute the aspect ratio of the kite. The aspect ratio is width / length * If the aspect ratio is greater than or equal to 1, print a warning message that a lower aspect ratio would provide more stability. * * Your output should be self-documenting. In other words, it should show the input with labels and then the output. You can see some examples of final outputs at the end. */ #include using std::cout; using std::cin; using std::endl; float kiteCalc(float wid, float len); float aspectCalc(float wid, float len); int main() { float kiteWidth = 0; float kiteLen = 0; float kiteArea = 0; cout << "Enter value for kite width in cm: "; cin >> kiteWidth; cout << endl << "Enter value for kite length in cm: "; cin >> kiteLen; cout << "\nYou have entered " << kiteWidth << "cm for kite width, and " << kiteLen << "cm for kite length." << endl; kiteArea = kiteCalc(kiteWidth, kiteLen); cout << "The area of the kite, in square meters, is: " << kiteArea << endl; aspectCalc(kiteWidth, kiteLen); } float kiteCalc(float wid, float len) { //calculate kite area in cm^2 float kiteAreaCalc = (wid * len)/2; //convert cm^2 to meters^2 kiteAreaCalc = kiteAreaCalc / 1000; return kiteAreaCalc; } float aspectCalc(float wid, float len) { float aspectRatioCalc = (wid / len); if (aspectRatioCalc >= 1) { cout << "Your kite has an aspect ratio of: " << aspectRatioCalc << endl; cout << "a lower aspect ratio would provide more stability. \n"; return 0; } else { return 0; } }