The statements in the following program are in incorrect order. Rearrange the st
ID: 3650044 • Letter: T
Question
The statements in the following program are in incorrect order. Rearrange the statements so that they prompt the user to input the shape type (rectangle, circle,or cylinder) and the appropriate dimension of the shape. The program then outputs the following information about the shape: For a rectangle, it outputs the area and perimeter; for a circle, it outputs the area and circumference; and for a cylinder, it outputs the volume and surface area. After rearranging the statements, you program should be properly indented. using namespace std; #include <iostream> int main() { string shape; double height; #include <string> cout << "Enter the shape type: (rectangle, circle, cylinder) "; cin >> shape; cout << endl; if (shape == "rectangle") { cout << "Area of the circle = " << PI * pow(radius, 2.0) << endl; cout << "Circumference of the circle: " << 2 * PI * pow(radius, 2.0) << endl; cout << "Enter the height of the cylinder: "; cin >> height; cout << endl; cout << "Enter the width of the rectangle: "; cin >> width; cout << endl;Explanation / Answer
You can use the following code:(Please get back to me in case of any syntax errors) using namespace std; #include #include #define PI 3.14159 int main() { string shape; double height,radius; cout > shape; cout height; coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.