From 7ab5241b448d59d6808dfd866c090bf352d9a99d Mon Sep 17 00:00:00 2001 From: JacobAKnox <91796123+JacobAKnox@users.noreply.github.com> Date: Fri, 15 Oct 2021 11:32:51 -0700 Subject: Adding broken version of my code --- BrokenCode/BrokenCode.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 BrokenCode/BrokenCode.cpp (limited to 'BrokenCode/BrokenCode.cpp') 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 +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; +} -- cgit v1.2.3