summaryrefslogtreecommitdiff
path: root/Project 1
diff options
context:
space:
mode:
authorJerichoBingham <[email protected]>2021-10-18 14:18:30 -0700
committerGitHub <[email protected]>2021-10-18 14:18:30 -0700
commit1f099300912bd3d7bbdbb928ce47a329f52a28c2 (patch)
tree105580ee66846d03aebbb476609dea361e2481d4 /Project 1
parentInitial commit (diff)
downloadcst116-proj1-jerichobingham-master.tar.xz
cst116-proj1-jerichobingham-master.zip
Create Project 1HEADmaster
Diffstat (limited to 'Project 1')
-rw-r--r--Project 159
1 files changed, 59 insertions, 0 deletions
diff --git a/Project 1 b/Project 1
new file mode 100644
index 0000000..84d143d
--- /dev/null
+++ b/Project 1
@@ -0,0 +1,59 @@
+//# include <iostream>
+//
+//using namespace std;
+//using std::.endl;
+//
+//int main()
+//{
+//
+// float radius, volume, height, pi;
+//
+// pi = 3.41;
+//
+// cout << " Figuring out the volume of a cylinder \n" << endl;
+//
+// cout << " Enter the radius of the cylinder: " << endl;
+// cin >> radius;
+//
+// cout << " Enter the height of the cylinder: " << endl;
+// cin >> height;
+//
+// volume = pi * pow(radius, 2) * height;
+//
+// cout << " The volume of the cylider is: " << volume << endl;
+//
+// return 0;
+//
+//}
+
+
+#include <iostream>
+
+using std::cout;
+
+using std::cin;
+
+const float PI = 3.14;
+
+int main()
+
+{
+
+ float radius, height, volume;
+
+ cout << "Welcome to the cylinder volume calculator!\n";
+
+ cout << "\nEnter cylinder radius: ";
+ cin >> radius;
+
+ cout << "\nEnter cylinder height: ";
+ cin >> height;
+
+ volume = PI * pow(radius, 2) * height;
+
+ cout << "\nThe volume of your cylinder is approximately ";
+ cout << volume << " cubed units.";
+
+ return 0;
+
+}