diff options
| author | BensProgramma <[email protected]> | 2021-10-15 22:01:37 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-10-15 22:01:37 -0700 |
| commit | 06f9af5f0f50b7f6dc19da0da7941e7a06027024 (patch) | |
| tree | d7aa2b47b93b158a7e078823909640c83804f039 | |
| parent | Initial commit (diff) | |
| download | archived-cst116-proj1-bensprogramma-06f9af5f0f50b7f6dc19da0da7941e7a06027024.tar.xz archived-cst116-proj1-bensprogramma-06f9af5f0f50b7f6dc19da0da7941e7a06027024.zip | |
Add files via upload
-The CST116_Project1_Schroeder.cpp file is my WORKING copy of the program (Documentation included in comments section of the program)
-The CST116_Project1_Schroeder_workingRun.txt file is the text output for my working program
-The CST116_Project1_BROKEN_Schroeder.cpp is a copy of my program with a Syntax Error and a Logic Error included in the code.
-The CST116_Project1_HernandezJimenez_BROKEN.cpp file is Freddy's program with my corrections
(note: A new project with Freddy's original code copied into it was needed to get the code from Freddy's Mac computer IDE to work in Visual Studio)
| -rw-r--r-- | CST116_Project1_BROKEN_Schroeder.cpp | 73 | ||||
| -rw-r--r-- | CST116_Project1_HernandezJimenez_BROKEN.cpp | 37 | ||||
| -rw-r--r-- | CST116_Project1_Schroeder.cpp | 78 | ||||
| -rw-r--r-- | CST116_Project1_Schroeder_workingRun.txt | 20 |
4 files changed, 208 insertions, 0 deletions
diff --git a/CST116_Project1_BROKEN_Schroeder.cpp b/CST116_Project1_BROKEN_Schroeder.cpp new file mode 100644 index 0000000..48662f4 --- /dev/null +++ b/CST116_Project1_BROKEN_Schroeder.cpp @@ -0,0 +1,73 @@ +// CST116_Project1_BROKEN_Schroeder.cpp : This file contains the 'main' function. Program execution begins and ends there.
+
+// Author: Benjamin Schroeder
+// Date: 10/13/2021 9:00pm
+// Email: [email protected]
+//
+
+/*Documentation of the meetings with your partner: when, where and what you discussed.
+ Email: Wed. 10/12/2021 9:00p
+ Topics discussed:
+ -What documentation is needed
+ psuedocode, actual code, errors, etc
+ -How to submit our documentation
+ -How to submit our code (working copy, error copy, corrected partner's, etc.)
+ Email: Fri. 10/15/2021 8:34p
+ Topics discussed:
+ -Corresponding by swapping files via email.
+ -Trouble getting Microsoft computer files to open on Mac
+ -
+
+
+*/
+
+/*Agile Questions (before I started work on this project):
+* What SPECIFIC task will you complete in the next half hour?
+* -Make requested errors in code for my project partner
+* What do you know about this SPECIFIC task?
+* -I know what a syntax error is
+* -I know what a logic error is
+* What DON'T you know about this SPECIFIC task?
+* -I don't know how well I will hide my errors
+*/
+
+
+/*Psuedocode:
+* Get Height of cylinder
+* Get Radius of cylinder
+* Compute Volume = pi*r^2*height
+* Output "The volume of this cylinder is: " Volume;
+*/
+
+// ACTUAL CODE
+#include <iostream>
+#include <iomanip>
+using namespace std;
+
+int main()
+{
+ // Initialize variables
+ float height;
+ float radius;
+ float pi = 3.141592654;
+ Float volume;
+
+ // Ask for dimensions of the cylinder
+ cout << "******************************************************************";
+ cout << "\n This program will tell you the volume of a cylinder \n";
+ cout << "******************************************************************\n";
+ cout << "\n\tPlease enter the radius of the cylinder (cm): ";
+ cin >> radius;
+ cout << "\n\tPlease enter the height of the cylinder (cm): ";
+ cin >> height;
+
+ // Compute the volume of the cylinder
+ volume = pi * radius * height;
+
+ // Output to user
+ cout << "\n\n\tThe volume of this cylinder is: " << volume << " cm^3\n\n\n ";
+
+ return 0;
+
+}
+
diff --git a/CST116_Project1_HernandezJimenez_BROKEN.cpp b/CST116_Project1_HernandezJimenez_BROKEN.cpp new file mode 100644 index 0000000..729fd5b --- /dev/null +++ b/CST116_Project1_HernandezJimenez_BROKEN.cpp @@ -0,0 +1,37 @@ +// CST116_Project1_HernandezJimenez_BROKEN.cpp : This file contains the 'main' function. Program execution begins and ends there.
+// **** Original program submitted by Frederico HernandezJimenez with errors 10/15/2021 7:58pm
+// **** This program was edited by Benjamin Schroeder 10/15/2021 8:34pm
+
+
+
+#include <iostream>
+//#define PI = 3.14; // This seems incorrect Syntax Error ...note: BAS 10/15/2021
+using namespace std;
+
+
+int main()
+{
+ //int volume = 0; // These should probably all be a float type ...note:BAS
+ float volume = 0.0; // to accept the value of PI ...note:BAS
+ //int Radius = 0;
+ float Radius = 0.0;
+ //int Height = 0;
+ float Height = 0.0;
+ float PI = 3.14; // Added this variable to incorporate PI, because the #define statement above didn't work ...note: BAS
+
+
+ cout << "Enter Radius: ";
+ cin >> Radius;
+
+ cout << "Enter Height: ";
+ cin >> Height;
+
+ //volume = 3.14 * Radius * Height; // incorrect logic expression for the volume of a cylinder ... note: BAS
+ volume = PI * Radius * Radius * Height; // Replaced the line above to give the correct expression ... note: BAS
+
+ cout << "The volume of the cylinder is approximately: " << volume << std::endl;
+
+
+ return 0;
+
+}
diff --git a/CST116_Project1_Schroeder.cpp b/CST116_Project1_Schroeder.cpp new file mode 100644 index 0000000..0f6a7c8 --- /dev/null +++ b/CST116_Project1_Schroeder.cpp @@ -0,0 +1,78 @@ +// CST116_Project1_Schroeder.cpp : This file contains the 'main' function. Program execution begins and ends there.
+// Author: Benjamin Schroeder
+// Date: 10/13/2021 7:53pm
+// Email: [email protected]
+//
+
+/*Documentation of the meetings with your partner: when, where and what you discussed.
+ Email: Wed. 10/12/2021 9:00p
+ Topics discussed:
+ -What documentation is needed
+ psuedocode, actual code, errors, etc
+ -How to submit our documentation
+ -How to submit our code (working copy, error copy, corrected partner's, etc.)
+ Email: Fri. 10/15/2021 8:34p
+ Topics discussed:
+ -Corresponding by swapping files via email.
+ -Trouble getting Microsoft computer files to open on Mac
+ -Problem was resolved via email:
+ Visual Studio Code was copied into email and sent to Mac computer.
+ Then that text copied to a newly created C++ Project on the Mac computer.
+ -Similarly the .cp file sent from the Mac needed to be opened in NotePad and
+ that text transeferred to a newly created C++ project on the Microsoft computer.
+
+
+*/
+
+/*Agile Questions (before I started work on this project):
+* What SPECIFIC task will you complete in the next half hour?
+* -Think about the problem (volume of a cylinder)
+* -Write psuedocode to ease the design process.
+* -If time allows, write the code.
+* -Also if time allows, make requested errors in code for my project partner
+* What do you know about this SPECIFIC task?
+* -The equation for volume of a cylinder ...pi*r^2*height
+* -<iostream> operators such as cout, cin, etc.
+* What DON'T you know about this SPECIFIC task?
+* -I don't know how fancy I should get with this program
+*/
+
+/*Psuedocode:
+* Get Height of cylinder
+* Get Radius of cylinder
+* Compute Volume = pi*r^2*height
+* Output "The volume of this cylinder is: " Volume;
+*/
+
+// ACTUAL CODE
+#include <iostream>
+#include <iomanip>
+using namespace std;
+
+int main()
+{
+ // Initialize variables
+ float height;
+ float radius;
+ float pi = 3.141592654;
+ float volume;
+
+ // Ask for dimensions of the cylinder
+ cout << "******************************************************************";
+ cout << "\n This program will tell you the volume of a cylinder \n";
+ cout << "******************************************************************\n";
+ cout << "\n\tPlease enter the radius of the cylinder (cm): ";
+ cin >> radius;
+ cout << "\n\tPlease enter the height of the cylinder (cm): ";
+ cin >> height;
+
+ // Compute the volume of the cylinder
+ volume = pi * radius * radius * height;
+
+ // Output to user
+ cout << "\n\n\tThe volume of this cylinder is: " << volume << " cm^3\n\n\n ";
+
+ return 0;
+
+}
+
diff --git a/CST116_Project1_Schroeder_workingRun.txt b/CST116_Project1_Schroeder_workingRun.txt new file mode 100644 index 0000000..7840fcb --- /dev/null +++ b/CST116_Project1_Schroeder_workingRun.txt @@ -0,0 +1,20 @@ +Run of CST116_Project1_Schroeder (Working Copy)
+
+******************************************************************
+ This program will tell you the volume of a cylinder
+******************************************************************
+
+ Please enter the radius of the cylinder (cm): 10.36
+
+ Please enter the height of the cylinder (cm): 25.95
+
+
+ The volume of this cylinder is: 8749.97 cm^3
+
+
+
+C:\Users\Lenovo\source\repos\CST116_Project1_Schroeder\Debug\CST116_Project1_Schroeder.exe (process 16696) exited with code 0.
+To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops.
+Press any key to close this window . . .
+
+
|