From f73459f1b1fc5f25e526712ffbb290608a1c4f13 Mon Sep 17 00:00:00 2001 From: WiserJ Date: Tue, 19 Oct 2021 21:40:31 -0700 Subject: 1 --- WiserProj1Main.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 WiserProj1Main.cpp (limited to 'WiserProj1Main.cpp') 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 +#include +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 -- cgit v1.2.3