summaryrefslogtreecommitdiff
path: root/CST116F2021-Proj1/CST116F2021-Proj1.cpp
blob: 28948d4f1a45808dd225e8fdcb762e51ab79c50a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//Pseudo Code
//	1. Define variables for radius and height of a cylinder.
//	2. Ask user for input of radius and height.
//	3. Calculate volume of a cylinder with these perameters and print

#include <iostream>
#include <iomanip>
using namespace std;

int main()
{
	float radius = 0;
	float height = 0;
	double volume = 0;

	cout << "Please enter the radius: ";
	cin >> radius;

	cout << "Please enter the height: ";
	cin >> height;

	volume = radius * radius * height * 3.14159;

	cout << "The volume of the given cylinder is: " << volume << " units cubed.\n";

	return 0;

}