Menu

Menu Switch Create Following Menu Area Circle B Area Triangle C Area Rectangle Anything El Q43839879

/* Menu with Switch Create the following menu: A: area of acircle B: area of a triangle C: area of a rectangle anything else -quit Use a SWITCH statement to test the user input. Print out thechoice (i.e. if the user enters a B, then print out “You want thearea 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 n”;cout << “B: Area of a Triangle n”; cout << “C: Area ofa Rectangle n”; cout << “D: Quit n”; // 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 n”; break; TRIANGLE: // input the triangle cout << “Enter theTrianglen “; cout << “Area of Rectangle is ” << area;} break; RECTANGLE: // input the rectangle cout << “Area of ArecTangle n “; cin >> rectangle; if (rectangle > 0) {cout << “Area of rectangle is ” << area; } else cout<< “An Error Message n “; break; default: cout << “quit the program .n”; } Return 0; }

Expert Answer


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

OR