summaryrefslogtreecommitdiff
path: root/CST116F2021-Proj1/joseph teneyck-debugging project 1.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'CST116F2021-Proj1/joseph teneyck-debugging project 1.cpp')
-rw-r--r--CST116F2021-Proj1/joseph teneyck-debugging project 1.cpp136
1 files changed, 136 insertions, 0 deletions
diff --git a/CST116F2021-Proj1/joseph teneyck-debugging project 1.cpp b/CST116F2021-Proj1/joseph teneyck-debugging project 1.cpp
new file mode 100644
index 0000000..f896d06
--- /dev/null
+++ b/CST116F2021-Proj1/joseph teneyck-debugging project 1.cpp
@@ -0,0 +1,136 @@
+// Joseph Ten Eyck - Cylinder Volume Calculation Program
+//
+//
+// PSEUDOCODE
+//
+// 1) DISPLAY program purpose and input constraints.
+// 2) Declare float variables for radius, height, and volume.
+// 3) Query user for radius value.
+// 4) Query user for height value.
+// 5) Calculate volume of cylinder.
+// 6) DISPLAY volume of cylinder.
+//
+//
+//========================================
+// THE CODE BELOW IS THE WORKING PROGRAM
+//========================================
+
+
+//#include <iostream>
+//
+//using std::cout;
+//using std::cin;
+//
+//int main()
+//{
+// float radius,
+// height,
+// volume;
+//
+// cout << "\n\t\tCalculate the volume of a cylinder!";
+// cout << "\n\t(Please only use positive numbers for radius and height)";
+//
+// cout << "\n\n\nInput radius: ";
+// cin >> radius;
+//
+// cout << "\nInput height: ";
+// cin >> height;
+//
+// volume = 3.14159235 * radius * radius * height;
+//
+// cout << "\n=============================";
+// cout << "\n\nVolume: " << volume;
+// cout << "\n\n";
+//
+// return 0;
+//
+//}
+
+
+//=============================================================
+// THE CODE BELOW INCLUDES 1 SYNTAX ERROR AND 1 LOGICAL ERROR
+//=============================================================
+
+
+//#include <iostream>
+//
+//using std::cout;
+//using std::cin;
+//
+//int main()
+//{
+// float radius,
+// height,
+// volume;
+//
+// cout << "\n\t\tCalculate the volume of a cylinder!";
+// cout << "\n\t(Please only use positive numbers for radius and height);
+//
+// cout << "\n\n\nInput radius: ";
+// cin >> radius;
+//
+// cout << "\nInput height: ";
+// cin >> height;
+//
+// volume = 3.14159235 * radius * radius + height;
+//
+// cout << "\n=============================";
+// cout << "\n\nVolume: " << volume;
+// cout << "\n\n";
+//
+// return 0;
+//
+//}
+
+
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+//===============================================
+// THE CODE BELOW IS WRITTEN BY JUSITN VALDIVIA
+//===============================================
+
+// Working code
+
+//#include <iostream>
+//
+//using std::cout;
+//using std::cin;
+//
+//int main()
+//{
+// float height, radius, volume;
+//
+// cout << "Please enter the height of your cylinder:";
+// cin >> height;
+//
+// cout << "Please enter the radius of your cylinder";
+// cin >> radius;
+//
+// volume = 3.1415 * height * radius * radius;
+// cout << "The volume of your cylinder is:" << volume;
+//
+// return 0;
+//}
+
+// Code with errors
+
+//#include <iostream>
+//
+//using std::cout;
+//using std::cin;
+//
+//float height, radiusvolume;
+//
+//cout << "Please enter the height of your cylinder:";
+//cin >> height;
+//
+//cout << "Please enter the radius of your cylinder";
+//cin >> radius;
+//
+//volume = 3.1415 * height * height * radius;
+//cout << "The volume of your cylinder is:" << volume;
+//
+//return 0;