Question: /* Menu with Switch Create the following menu: A: area of a circle B: area of a triangle C: area of a rectangle anything else

/* Menu with Switch Create the following menu: A: area of a circle B: area of a triangle C: area of a rectangle anything else - quit Use a SWITCH statement to test the user input. Print out the choice (i.e. if the user enters a B, then print out "You want the area of a triangle."*/ #include using namespace std; int main() { //Variable int choice; double circle, triangle, rectangle ; //displaying menu choice cout << "A: Area of a Circle "; cout << "B: Area of a Triangle "; cout << "C: Area of a Rectangle "; cout << "D: Quit "; // choices cout << "Enter your choices(A-D): "; cin >> choice; //responding to the user choice switch (choice) CIRCLE: // inputting CIRCLE cout << "You want the Area of the circle "; break; TRIANGLE: // input the triangle cout << "Enter the Triangle "; cout << "Area of Rectangle is " << area; } break; RECTANGLE: // input the rectangle cout << "Area of A recTangle "; cin >> rectangle; if (rectangle > 0) { cout << "Area of rectangle is " << area; } else cout << "An Error Message "; break; default: cout << " quit the program . "; } Return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!