Computers and Technology
Computers and Technology, 18.09.2019 17:30, epmeche05

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

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 06:50, Mordred809
Type the correct answer in the box. spell all words correctly. which view of report creation allows you to customize the report before the database program creates it? creating a report in allows you to customize the report before the database program creates it. pl asap
Answers: 1
image
Computers and Technology, 22.06.2019 10:30, robert7248
You have a large, late-model pick-up truck with a rear seat. the pick-up truck weighs 6,500 pounds. the florida seat belt law
Answers: 1
image
Computers and Technology, 22.06.2019 22:00, lgary9462
Perform the following tasks: a. create a class named testclass that holds a single private integer field and a public constructor. the only statement in the constructor is one that displays the message “constructing”. write a main()function that instantiates one object of the testclass. save the file as testclass. cpp in the chapter 08 folder. run the program and observe the results. b. write another main()function that instantiates an array of 10 testclass objects. save the file as test class array. c . run this program and observe the results.
Answers: 1
image
Computers and Technology, 23.06.2019 21:40, jeovontamarley
language consists of basic components, and they are called a. 3; mental images, concepts, and speech b. 2; language acquisition and linguistic relativity c. 3; heuristics, algorithms, and analogies d. 4; phonemes, morphemes, syntax, and semantics e. 2; words and grammar
Answers: 3
Do you know the correct answer?
The statements in the file main. cpp are in incorrect order. rearrange the statements so that they p...

Questions in other subjects:

Konu
Biology, 27.10.2021 14:00
Konu
English, 27.10.2021 14:00
Konu
Geography, 27.10.2021 14:00