/* CSCI 261 Lab03B: Triangles Classifier + Options Menu * * Author: _INSERT_YOUR_NAME_HERE_ * * The goal of this lab is to practice the use of if-else statements to classify triangles based on their sides. * It will also teach you how to correctly compare double values for equality using a tolerance factor and * the use of a menu of options using the switch statement. */ #include // For cin, cout, etc. #include // For string class #include // For math functions using namespace std; const double TOLERANCE = 0.0001; int main() { int option; // to store the user's option (1-5) double inputA, inputB, inputC; // to store user's side measurements double a, b, c; // to copy side measurements such that c >= a and c >= b bool isTriangle = false; // states whether a,b,c can be used as sides of a triangle do { // we haven't learned loops yet, but you can guess what this do-while does // show the menu cout << "\n1. Enter measurements\n"; cout << "2. Print measurements\n"; cout << "3. Check triangle feasibility\n"; cout << "4. Classify triangle\n"; cout << "5. Exit\n"; // read user's choice cout << "Please, choose an option: "; cin >> option; // ignore option if not 1-5 if (option < 1 || option > 5) { cout << "Invalid option!\n"; continue; } /******** INSERT YOUR CODE BELOW HERE ********/ /******** INSERT YOUR CODE ABOVE HERE ********/ } while (option != 5); return EXIT_SUCCESS; // signals the operating system that our program ended OK. }