Question: make flowchart for the following code be as detailed as possible #include #include using namespace std; int main() { const int areaCircle = 1, areaRectangle

make flowchart for the following code be as detailed as possible

#include #include

using namespace std; int main() { const int areaCircle = 1, areaRectangle = 2, areaTriangle = 3, Quit = 4; int area = 0, radius, length, width, height, base, choice; double pi = 3.14159; cout << fixed << showpoint << setprecision(4);

do { cout << "1. Calculate the Area of a Circle" << endl; cout << "2. Calculate the Area of a Rectangle" << endl; cout << "3. Calculate the Area of a Triangle" << endl; cout << "4. Quit" << endl; cout << "Enter your choice (1-4):" << endl; cin>>choice; while (choice < areaCircle || choice > Quit){ cout << "Please enter a choices 1-4: "; cin >> choice; } if (choice != Quit) { switch (choice) { case areaCircle: cout<< "What is the radius of the circle"; cin>>radius; if (radius <= 0) { cout<<"Error. The radius must be a positive number"<>radius; } area = pi * radius; break; case areaRectangle: cout<< "What is the length of the rectangle"; cin>>length; if (length <= 0) { cout<<"Error. The length must be a positive number"<>length; } cout<< "What is the width of the rectangle"; cin>>width; if (width <= 0) { cout<<"Error. The width must be a positive number"<>width; area = length * width; } break; case areaTriangle: cout<< "What is the length of the base of the triangle"; cin>>base; if (base <= 0) { cout<<"Error. The base must be a positive number"<>height; } cout<< "What is the height of the triangle"; cin>>height; if (height <= 0) { cout<<"Error. The height must be a positive number"<>height; } area = base * height * 0.5; break; } cout<<"The area is: "<

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!