subject

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 dimension of the shape. note: for grading purposes place the cylinder height statement before the radius statement. the c++ program then outputs the following information about the shape: for a rectangle, it outputs the area and perimeterfor a circle, it outputs the area and circumferencefor a cylinder, it outputs the volume and surface area. after rearranging the statements, your program should be properly indented. here is the code out-of-order: using namespace std; #include int main(){ string shape; double height; #include 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 * radius < < endl; cout < < "enter the height of the cylinder: "; cin > > height; cout < < endl; cout < < "enter the width of the rectangle: "; cin > > width; cout < < endl; cout < < "perimeter of the rectangle = " < < 2 * (length + width) < < endl; double width; } cout < < "surface area of the cylinder: " < < 2 * pi * radius * height + 2 * pi * pow(radius, 2.0) < < endl; } else if (shape == "circle") { cout < < "enter the radius of the circle: "; cin > > radius; cout < < endl; cout < < "volume of the cylinder = " < < pi * pow(radius, 2.0)* height < < endl; double length; } return 0; else if (shape == "cylinder") { double radius; cout < < "enter the length of the rectangle: "; cin > > length; cout < < endl; #include cout < < "enter the radius of the base of the cylinder: "; cin > > radius; cout < < endl; const double pi = 3.1416; cout < < "area of the rectangle = " < < length * width < < endl; else cout < < "the program does not handle " < < shape < < endl; cout < < fixed < < showpoint < < setprecision(2); #include

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:30
What is the most popular genre of video games?
Answers: 1
question
Computers and Technology, 23.06.2019 08:30
When you interpret the behavior of others according to your experiences and understanding of the world your evaluation is
Answers: 1
question
Computers and Technology, 24.06.2019 00:30
Match the sentence fragment in the first column with the appropriate ending in the second column. a little per favore?
Answers: 1
question
Computers and Technology, 24.06.2019 08:20
Evaluate the scenario below and indicate how to handle the matter appropriately. situation: michael received an e-mail from what he thought was his doctor’s office, requesting his social security number. since he had just been in to see his doctor last week, he replied to the e-mail with his social security number.
Answers: 2
You know the right answer?
The statements in the file main. cpp are in incorrect order. rearrange the statements so that they p...
Questions
question
Mathematics, 03.02.2021 07:10
question
Mathematics, 03.02.2021 07:10
question
Mathematics, 03.02.2021 07:10
question
Mathematics, 03.02.2021 07:10
Questions on the website: 13722367