summaryrefslogtreecommitdiff
path: root/WiserProj1Main.cpp
diff options
context:
space:
mode:
authorWiserJ <[email protected]>2021-10-19 21:40:31 -0700
committerWiserJ <[email protected]>2021-10-19 21:40:31 -0700
commitf73459f1b1fc5f25e526712ffbb290608a1c4f13 (patch)
tree0ba2fd32f157acc215d27934bebd40a66036166c /WiserProj1Main.cpp
parentInitial commit (diff)
downloadarchived-cst116-proj1-jeffwoit-f73459f1b1fc5f25e526712ffbb290608a1c4f13.tar.xz
archived-cst116-proj1-jeffwoit-f73459f1b1fc5f25e526712ffbb290608a1c4f13.zip
1
Diffstat (limited to 'WiserProj1Main.cpp')
-rw-r--r--WiserProj1Main.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/WiserProj1Main.cpp b/WiserProj1Main.cpp
new file mode 100644
index 0000000..c3636ad
--- /dev/null
+++ b/WiserProj1Main.cpp
@@ -0,0 +1,32 @@
+//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()
+{
+ //define variable
+ float radius = 0;
+ float height = 0;
+ double volume = 0;
+
+ //ask for user input radius
+ cout << "Please enter the radius: ";
+ cin >> radius;
+
+ //ask for user input height
+ cout << "Please enter the height: ";
+ cin >> height;
+
+ //calculations
+ volume = radius * radius * height * 3.14159;
+
+ //output answer
+ cout << "The volume of the given cylinder is: " << volume << " units cubed.\n";
+
+ return 0;
+} \ No newline at end of file