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 <

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education