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, 21.06.2019 19:40
Write the quartstogallons java class that declares a named constant to hold the number of quarts in a gallon (4). also declare a variable to represent the number of quarts needed for a painting job, and assign an appropriate value—for example, 18. compute and display the number of gallons and quarts needed for the job. display explanatory text with the values, for example:
Answers: 2
question
Computers and Technology, 23.06.2019 09:00
The first screen you see when you open word2016 what is called?
Answers: 1
question
Computers and Technology, 23.06.2019 19:30
2. fluorine and chlorine molecules are blamed fora trapping the sun's energyob forming acid rainoc producing smogod destroying ozone molecules
Answers: 2
question
Computers and Technology, 23.06.2019 19:30
What are loans to a company or government for a set amount of time
Answers: 1
You know the right answer?
The statements in the file main. cpp are in incorrect order. rearrange the statements so that they p...
Questions
Questions on the website: 13722360