Question: Problem: Consider the following program in which the statements are in the incorrect order. Rearrange the statements so that the program prompts the user to

Problem:

Consider the following program in which the statements are in the incorrect order.

Rearrange the statements so that the program prompts the user to input:

The height of the base of a cylinder

The radius of the base of a cylinder

The program then outputs:

The volume of the cylinder.

The surface area of the cylinder

Format the output to two decimal places.

----------------------------------------------------------------------------------------------------------------------------------------------------

#include #include int main() {} double height; cout << "Volume of the cylinder = " << PI * pow(radius, 2.0) * height << endl; cout << "Enter the height of the cylinder: "; cin >> radius; cout << endl; return 0; double radius; cout << "Surface area: " << 2 * PI * radius * height + 2 * PI * pow(radius, 2.0) << endl; cout << fixed << showpoint << setprecision(2); cout << "Enter the radius of the base of the cylinder: "; cin >> height; cout << endl; #include const double PI = 3.14159; using namespace std;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!