summaryrefslogtreecommitdiff
path: root/Bens Fixed Code.cp
diff options
context:
space:
mode:
Diffstat (limited to 'Bens Fixed Code.cp')
-rw-r--r--Bens Fixed Code.cp31
1 files changed, 31 insertions, 0 deletions
diff --git a/Bens Fixed Code.cp b/Bens Fixed Code.cp
new file mode 100644
index 0000000..ab75aac
--- /dev/null
+++ b/Bens Fixed Code.cp
@@ -0,0 +1,31 @@
+
+#include <iostream>
+#include <iomanip>
+
+using namespace std;
+
+int main()
+
+{
+ float height;
+ float radius;
+ float pi = 3.141592654;
+ float volume;
+
+
+ cout << "******************************************************************";
+ cout << "\n This program will tell you the volume of a cylinder \n";
+ cout << "******************************************************************\n";
+ cout << "\n\tPlease enter the radius of the cylinder (cm): ";
+ cin >> radius;
+ cout << "\n\tPlease enter the height of the cylinder (cm): ";
+ cin >> height;
+
+
+ volume = pi * radius * radius * height;
+
+
+ cout << "\n\n\tThe volume of this cylinder is: " << volume << " cm^3\n\n\n ";
+
+ return 0;
+}