t The statements in the following program are in incorrect order. Rearrange the
ID: 3737504 • Letter: T
Question
t The statements in the following program are in incorrect order. Rearrange the statements so that they prompt the user to input the shape type (rectangle, circle, or cylinder) and the appropriate dimension of the shape. The program then outputs the following information about the shape: For a rectangle, it outputs the area and perimeter; for a circle it outputs the area and circumference; and for a cylinder, it outputs the volume and surface area. After rearranging the statements, your program should be properly indented. using namespace stdi lincludeExplanation / Answer
Solution:
The header files will be on the top
so,
#include<iostream>
#include<cmath>
#include<string>
#include<iomanip>
double width; on the second page; should be declared before it is used in the code
because variable declaration needs to be done before it is used in the code
The line which is like cout<<"Surface area of the cylinder: "<< on the second page should be inside the else if block of the cylinder
I hope this helps if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.