From bc35a0f827f5fad99bd21e27e922d83e98fa17cc Mon Sep 17 00:00:00 2001 From: Joseph Ten Eyck Date: Tue, 19 Oct 2021 15:19:44 -0700 Subject: Code and successful runs for the debugging project 1. --- CST116F2021-Proj1/CST116F2021-Proj1.cpp | 20 --- CST116F2021-Proj1/CST116F2021-Proj1.vcxproj | 2 +- .../CST116F2021-Proj1.vcxproj.filters | 2 +- .../joseph teneyck-debugging project 1.cpp | 136 +++++++++++++++++++++ CST116F2021-Proj1/runs.txt | 44 +++++++ 5 files changed, 182 insertions(+), 22 deletions(-) delete mode 100644 CST116F2021-Proj1/CST116F2021-Proj1.cpp create mode 100644 CST116F2021-Proj1/joseph teneyck-debugging project 1.cpp create mode 100644 CST116F2021-Proj1/runs.txt diff --git a/CST116F2021-Proj1/CST116F2021-Proj1.cpp b/CST116F2021-Proj1/CST116F2021-Proj1.cpp deleted file mode 100644 index 8bcb373..0000000 --- a/CST116F2021-Proj1/CST116F2021-Proj1.cpp +++ /dev/null @@ -1,20 +0,0 @@ -// CST116F2021-Proj1.cpp : This file contains the 'main' function. Program execution begins and ends there. -// - -#include - -int main() -{ - std::cout << "Hello World!\n"; -} - -// Run program: Ctrl + F5 or Debug > Start Without Debugging menu -// Debug program: F5 or Debug > Start Debugging menu - -// Tips for Getting Started: -// 1. Use the Solution Explorer window to add/manage files -// 2. Use the Team Explorer window to connect to source control -// 3. Use the Output window to see build output and other messages -// 4. Use the Error List window to view errors -// 5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project -// 6. In the future, to open this project again, go to File > Open > Project and select the .sln file diff --git a/CST116F2021-Proj1/CST116F2021-Proj1.vcxproj b/CST116F2021-Proj1/CST116F2021-Proj1.vcxproj index acf4e53..f23400b 100644 --- a/CST116F2021-Proj1/CST116F2021-Proj1.vcxproj +++ b/CST116F2021-Proj1/CST116F2021-Proj1.vcxproj @@ -139,7 +139,7 @@ - + diff --git a/CST116F2021-Proj1/CST116F2021-Proj1.vcxproj.filters b/CST116F2021-Proj1/CST116F2021-Proj1.vcxproj.filters index 96bd064..2149fa4 100644 --- a/CST116F2021-Proj1/CST116F2021-Proj1.vcxproj.filters +++ b/CST116F2021-Proj1/CST116F2021-Proj1.vcxproj.filters @@ -15,7 +15,7 @@ - + Source Files 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 +// +//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 +// +//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 +// +//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 +// +//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; diff --git a/CST116F2021-Proj1/runs.txt b/CST116F2021-Proj1/runs.txt new file mode 100644 index 0000000..fc45df1 --- /dev/null +++ b/CST116F2021-Proj1/runs.txt @@ -0,0 +1,44 @@ +=========================================== += THIS TEXT FILE CONTAINS SUCCESSFUL RUNS = +=========================================== + + + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Joseph Ten Eyck's code run is below +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + Calculate the volume of a cylinder! + (Please only use positive numbers for radius and height) + + +Input radius: 2.3 + +Input height: 9.1 + +============================= + +Volume: 151.233 + + +C:\Users\eclip\source\repos\cst116 - debugging project 1 - joseph ten eyck\x64\Debug\CST116F2021-Proj1.exe (process 18364) 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 . . . + + + + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Justin Valdivia's code run is below +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Please enter the height of your cylinder:23 +Please enter the radius of your cylinder1.2 +The volume of your cylinder is:104.046 +C:\Users\eclip\source\repos\cst116 - debugging project 1 - joseph ten eyck\x64\Debug\CST116F2021-Proj1.exe (process 3560) 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 . . . -- cgit v1.2.3