diff options
Diffstat (limited to 'WiserProj1Main.cpp')
| -rw-r--r-- | WiserProj1Main.cpp | 32 |
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 |