Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Instructions The statements in the file main.cpp are in incorrect order. Rearrange the statements so that they prompt the user to input: The shape type (rectangle, circle, or cylinder) The appropriate...

1 answer below »

Instructions

The statements in the filemain.cppare in incorrect order.

Rearrange the statements so that they prompt the user to input:

  • The shape type (rectangle, circle, or cylinder)
  • The appropriate dimension of the shape.

Note: For grading purposes place the cylinder height statement before the radius statement.

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
  • For a cylinder, it outputs the volume and surface area.

Use3.1416as the constant value for any calculations that may need\piπ.

After rearranging the statements, your program should be properly indented.

Please see attached detaild instructions.

Answered Same Day Oct 09, 2021

Solution

Sathishkumar answered on Oct 10 2021
126 Votes
#include #include #include #include using namespace std;
int main()
{
string shape;
double height;
double length;
    double width;
    double radius;
const double PI = 3.1416;
    
cout
"Enter the shape type: (rectangle, circle, cylinder) ";
cin
shape;
cout
endl;

if (shape == "rectangle")
{
    
    cout
"Enter the length of the rectangle: ";
cin
length;
cout
endl;

        cout
"Enter the width of the rectangle:...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here