From 05bdc596093f2df32e63c1447dcd9affa19716af Mon Sep 17 00:00:00 2001 From: IsabellaMon <91996332+IsabellaMon@users.noreply.github.com> Date: Tue, 19 Oct 2021 16:49:12 -0700 Subject: Add files via upload Module 3 Project 1 --- M3P1Mon.txt | 122 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 M3P1Mon.txt diff --git a/M3P1Mon.txt b/M3P1Mon.txt new file mode 100644 index 0000000..f1d929c --- /dev/null +++ b/M3P1Mon.txt @@ -0,0 +1,122 @@ +CST116 +Module 3: Project 1 +P 115 +5.10 Programming Exercises +#2 +PSEUDOCODE: + Display "Input cylinder radius: " + Read radius + + Display "Input cylinder height: " + Read Height + + Volume = 3.1415 * radius * radius * height; + + Display "Cylinder volume is approximately " and insert volume + +WORKING CODE: + #include + using namespace std; + + int main() + { + float radius = 0; + float height = 0; + float volume = 0; + + cout << "Input cylinder radius: "; + cin >> radius; + + cout << "Input cylinder height: "; + cin >> height; + + volume = 3.1415 * radius * radius * height; + + cout << "Cylinder volume is approximately " << volume << endl; + + return 0; + } +/* +Isabella Mon +isabella.jmon@gmail.com +*/ + +RUN: + Input cylinder radius: 5 + Input cylinder height: 4 + Cylinder volume is approximately 314.15 + + +MY ERRORS: + #include + using namespace std; + + int main() + { + float radius = 0; + float height = 0; + volume = 0; + + cout << "Input cylinder radius: "; + cin >> radius; + + cout << "Input cylinder height: "; + cin >> height; + + volume = 3.1415 * radius * 2 * height; + + cout << "Cylinder volume is approximately " << volume << endl; + + return 0; + } + +TYLER'S CORRECTED CODE: + #include + using namespace std; + + int main() + { + float PI = 3.1415; + float radius, height, volume; + + cout << "Input the height of your cyclinder: " << endl; + cin >> height; + + cout << "Input the radius of your cylcinder: " << endl; + cin >> radius; + + volume = PI * height * radius * radius; + + cout << "The volume of your cyclinder is " << volume << endl; + + return 0; + } + +/* +Tyler Taormina +tktaormina@gmail.com +*/ + +RUN: + Input the height of your cyclinder: + 5 + Input the radius of your cylcinder: + 4 + The volume of your cyclinder is 251.32 + +MEETINGS: +10/12/21 - In class, discussed timeline and set up next meeting. +10/15/21 - Over the phone, exchanged code and confirmed deadline. + +AGILE QUESTIONS: +A) + 1. I must write a program that takes the inputs of the height and + radius to calculate the volume of a cylinder. + 2. I know I have to eventually put 2 errors in and swap codes with my partner. + 3. I don't know the formula to calculate the volume of a cylinder. + +B) + 1. I must find the 2 errors in my partners' program and fix them. + 2. I know that one of the errors has to be a logic error and the other + has to be a syntax error. + 3. Is there multiple ways to fix these errors? \ No newline at end of file -- cgit v1.2.3