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 13:00
We as humans write math expression in infix notation, e.g. 5 + 2 (the operators are written in-between the operands). in a computer’s language, however, it is preferred to have the operators on the right side of the operands, i.e. 5 2 +. for more complex expressions that include parenthesis and multiple operators, a compiler has to convert the expression into postfix first and then evaluate the resulting postfix.write a program that takes an “infix” expression as input, uses stacks to convert it into postfix expression, and finally evaluates it. it must support the following operations: + - / * ^ % (example infix expression: (7 - 3) / (2 + 2)postfix expression: 7 3 - 2 2 + /result: 1guidelines: 1. you will need to use stacks in three placesa. one for the parenthesis check [char stack]b. one during infix to postfix [char stack]c. one during evaluation [int stack]for a and b above, you can use same array and same push, pop method as both ofthem are char. but for evaluation you have int stack and you might consider to createanother push pop method to handle it. maybe push_int, pop_int, etc. or find otherstrategy to utilize existing push pop method2. you can create a function for obtaining operator priority. that function should take anoperator as input and return its priority as an integer. this function will you a lot andreduce repeated code3. during evaluation you will need to convert char into integer. example for single digit: char c = '5'; int x = c - '0';
Answers: 2
question
Computers and Technology, 22.06.2019 19:00
How is the number 110 written when expanded out to place values in the base 2 (binary) number system? options: 2 x 4 + 3 x 2 + 4 x 1 1 x 2 + 1 x 2 + 0 x 2 1 x 100 + 1 x 10 + 0 x 1 1 x 4 + 1 x 2 + 0 x 1
Answers: 1
question
Computers and Technology, 24.06.2019 04:30
Write and test a python program to find and print the largest number in a set of real (floating point) numbers. the program should first read a single positive integer number from the user, which will be how many numbers to read and search through. after reading in all of the numbers, the largest of the numbers input (not considering the count input) should be printed.
Answers: 1
question
Computers and Technology, 24.06.2019 13:00
What are some websites that you can read manga (ex: manga rock)
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
Mathematics, 23.04.2020 01:48