2.13 LAB: Volume and area of cylinder The volume and area of a cylinder are calculated as: • Volume = 1tr²h • Area = 2rurh + 2rr² Given the radius and height of a cylinder as floating-point (double) numbers, output the volume and area of the cylinder. Hint: Use pow() and M_PI in your calculations. Output each floating-point value with two digits after the decimal point using the following statement once before all other cout statements: cout << fixed <

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter7: Arrays
Section: Chapter Questions
Problem 7PP: (Numerical) Using the srand() and rand() C++ library functions, fill an array of 1000 floating-point...
icon
Related questions
icon
Concept explainers
Question
2.13 LAB: Volume and area of cylinder
The volume and area of a cylinder are calculated as:
• Volume = 1tr²h
• Area = 2rtrh + 2rr²
Given the radius and height of a cylinder as floating-point (double) numbers, output the volume and area of the cylinder.
Hint: Use pow() and M_PI in your calculations.
Output each floating-point value with two digits after the decimal point using the following statement once before all other cout
statements:
cout << fixed <<setprecision (2);
Ex: If the input is:
5.2 8.1
where 5.2 is the radius of the cylinder and 8.1 is the height of the cylinder, then the output is:
Volume (cubic inches): 688.08
Surface area (square inches): 434.55
LAB
ACTIVITY
2.13.1: LAB: Volume and area of cylinder
1 #include <iostream>
2 #include <iomanip>
3 #include <math.h>
during pom
main.cpp
0/10
Load default template...
Transcribed Image Text:2.13 LAB: Volume and area of cylinder The volume and area of a cylinder are calculated as: • Volume = 1tr²h • Area = 2rtrh + 2rr² Given the radius and height of a cylinder as floating-point (double) numbers, output the volume and area of the cylinder. Hint: Use pow() and M_PI in your calculations. Output each floating-point value with two digits after the decimal point using the following statement once before all other cout statements: cout << fixed <<setprecision (2); Ex: If the input is: 5.2 8.1 where 5.2 is the radius of the cylinder and 8.1 is the height of the cylinder, then the output is: Volume (cubic inches): 688.08 Surface area (square inches): 434.55 LAB ACTIVITY 2.13.1: LAB: Volume and area of cylinder 1 #include <iostream> 2 #include <iomanip> 3 #include <math.h> during pom main.cpp 0/10 Load default template...
LAB
ACTIVITY
1 #include <iostream>
2 #include <iomanip>
3 #include <math.h>
4 using namespace std;
S
6 int main() {
7
7
8
2.13.1: LAB: Volume and area of cylinder
9
9
10
11
11
12
13
14
15}
double radius;
double height;
double volume;
double area;
/* Type your code here */
return 0;
Develop mode
Submit mode
Enter program input (optional)
5.2 8.1
Run program
Program errors displayed here
main.cpp
Input (from above) >>
Run your program as often as you'd like, before submitting for grading. Below, type any needed
input values in the first box, then click Run program and observe the program's output in the
second box.
main.cpp
(Your program)
0/10
Load default template...
Output (shown below)
Transcribed Image Text:LAB ACTIVITY 1 #include <iostream> 2 #include <iomanip> 3 #include <math.h> 4 using namespace std; S 6 int main() { 7 7 8 2.13.1: LAB: Volume and area of cylinder 9 9 10 11 11 12 13 14 15} double radius; double height; double volume; double area; /* Type your code here */ return 0; Develop mode Submit mode Enter program input (optional) 5.2 8.1 Run program Program errors displayed here main.cpp Input (from above) >> Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the first box, then click Run program and observe the program's output in the second box. main.cpp (Your program) 0/10 Load default template... Output (shown below)
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Control Structure
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,