2. Complete a program below. The program will read base and height values of a cylinder from the user. Then, the program will call a function to calculate the volume of the cylinder by using the...


This is C++ PRogramming


2. Complete a program below. The program will read base and height values of a cylinder<br>from the user. Then, the program will call a function to calculate the volume of the<br>cylinder by using the formula below. It will then call another function to display the<br>volume of the cylinder. Given the value of PI is 3.142.<br>volume= 1/3 x pi xrxh<br>#include <iostream><br>using namespace std;<br>I/declare global constant for PI<br>//declare function prototype for both functions<br>void main )<br>double base, height, area;<br>cout<<>base; cout<"enter height="" of="" a="" triangle:="" ";="" cin="">>height; volume - calculate_volume (base, height); display_area (volume); // function calculate volume goes here // function display goes here "/>
Extracted text: 2. Complete a program below. The program will read base and height values of a cylinder from the user. Then, the program will call a function to calculate the volume of the cylinder by using the formula below. It will then call another function to display the volume of the cylinder. Given the value of PI is 3.142. volume= 1/3 x pi xrxh #include using namespace std; I/declare global constant for PI //declare function prototype for both functions void main ) double base, height, area; cout<"enter base="" of="" a="" triangle:="" ";="" cin="">>base; cout<"enter height="" of="" a="" triangle:="" ";="" cin="">>height; volume - calculate_volume (base, height); display_area (volume); // function calculate volume goes here // function display goes here

Jun 03, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here