diff options
| author | JacobAKnox <[email protected]> | 2021-10-15 11:32:51 -0700 |
|---|---|---|
| committer | JacobAKnox <[email protected]> | 2021-10-15 11:32:51 -0700 |
| commit | 7ab5241b448d59d6808dfd866c090bf352d9a99d (patch) | |
| tree | 0a08e0bdbbe4086c5bd848d6f79155f4220b87f9 /BrokenCode/BrokenCode.cpp | |
| parent | Working version (diff) | |
| download | cst116-proj1-jacobaknox-7ab5241b448d59d6808dfd866c090bf352d9a99d.tar.xz cst116-proj1-jacobaknox-7ab5241b448d59d6808dfd866c090bf352d9a99d.zip | |
Adding broken version of my code
Diffstat (limited to 'BrokenCode/BrokenCode.cpp')
| -rw-r--r-- | BrokenCode/BrokenCode.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/BrokenCode/BrokenCode.cpp b/BrokenCode/BrokenCode.cpp new file mode 100644 index 0000000..73e5c44 --- /dev/null +++ b/BrokenCode/BrokenCode.cpp @@ -0,0 +1,20 @@ +// BrokenCode.cpp : This file contains the 'main' function. Program execution begins and ends there. +//This file has one logic and one syntax error + +#include <iostream> +using namespace std; + +int main() +{ + const double PI = 3.142; + double radius, height, volume; + + cout << "Input the cylinder's radius: "; + cin >> radius; + cout << "Input the cylinder's height: "; + cin >> height; + + volume = radius * radius * radius * PI * height; + cout.precision(3); + cout << fixed << "The volume of a cyliner with radius: " << radius + ", and height: " << height << ", is " << volume; +} |