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 21:00
It is not a good idea in a cover letter to mention another person whom the employer knows.
Answers: 1
question
Computers and Technology, 22.06.2019 05:00
Pls do you believe that the use of 3d animation has grown in feature films over the last few years? if so, do you think the trend will continue? what are the forces driving this trend?
Answers: 2
question
Computers and Technology, 23.06.2019 14:30
Select the correct answer. peter has launched a website that features baby products. however, clients often find they are unable to access the website because the server is down. which feature of cybersecurity should peter focus on for his website? a. data authenticity b. data privacy c. data availability d. data integrity e. data encryption
Answers: 3
question
Computers and Technology, 23.06.2019 18:30
Report all segments of identity by descent longer than 20 polymorphisms between pairs of individuals in the following cohort of 15 individuals across 49 polymorphisms: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 numeric input 2 points possible (graded) you have 2 attempts to complete the assignment below. for example if the sequence is "bcd", which occurs in "abcdef" , the starting point would be 2 (b), and the finishing point would be 4(d). individuals 7,10 between positions
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
question
English, 26.10.2021 19:20
question
Chemistry, 26.10.2021 19:20
question
English, 26.10.2021 19:20
question
Arts, 26.10.2021 19:20
Questions on the website: 13722359