aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CST116-Ch10-Debugging/CST116 ch10 output.txt24
-rw-r--r--CST116-Ch10-Debugging/CST116 ch10 pseudo code.txt19
-rw-r--r--CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp4
3 files changed, 46 insertions, 1 deletions
diff --git a/CST116-Ch10-Debugging/CST116 ch10 output.txt b/CST116-Ch10-Debugging/CST116 ch10 output.txt
new file mode 100644
index 0000000..d9b977f
--- /dev/null
+++ b/CST116-Ch10-Debugging/CST116 ch10 output.txt
@@ -0,0 +1,24 @@
+Please enter your first name: Thomas
+
+Please enter your last name: Trinh
+
+
+ Welcome Thomas Trinh!
+ Hope all is well
+
+ x y z
+
+ 0 100 -99
+ 99 101 102
+ 2 102 104
+ 3 103 106
+ 4 104 108
+ 5 105 110
+ 6 106 112
+ 7 107 114
+ 8 108 116
+ 9 109 118
+
+C:\Users\furyf\OneDrive\Desktop\Homework\CST Homework\CST116 Chp10\CST116-Ch10-Debugging\x64\Debug\CST116-Ch10-Debugging.exe (process 9716) 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 . . .
diff --git a/CST116-Ch10-Debugging/CST116 ch10 pseudo code.txt b/CST116-Ch10-Debugging/CST116 ch10 pseudo code.txt
new file mode 100644
index 0000000..e3859c7
--- /dev/null
+++ b/CST116-Ch10-Debugging/CST116 ch10 pseudo code.txt
@@ -0,0 +1,19 @@
+Under main
+set varX, varY, and varZ to have size amount of elements
+set function GetAndDisplayWelcomeInfo:
+ set character name as 2 sets of 20 values
+ output "please enter your first name:"
+ input name of first element
+ output "please enter your last name:"
+ input name of second element
+ output "welcome 1st name element and 2nd name element"
+ and "hope all is well"
+set funcion FunctionOne with (varX, varY):
+ set values in varX to values of 0 to anything less than size
+ set values in varY to be varX above plus 100
+set function FunctionTwo with (varX, varY, and varZ)
+ set values in varZ to be varX plus varY
+set function PrintFunction with (varX, varY, varZ)
+ set variable x
+ output "x y z"
+ set output varX, varY, and varZ \ No newline at end of file
diff --git a/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp b/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp
index e9300c0..13790cb 100644
--- a/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp
+++ b/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp
@@ -87,7 +87,7 @@ void PrintFunction(const int varX[], const int varY[],
const int SIZE = 10;//changed from 5 to 10
int main()
-{
+{
int varX[SIZE]; //changed all 5s to SIZE
int varY[SIZE];
int varZ[SIZE]; // Notice how we used the const here!
@@ -100,6 +100,8 @@ int main()
// Breakpoint 3
// Put breakpoint on the following line
FunctionTwo(varX, varY, varZ);
+ varX[1] = 99; //assigning varX so that the 2nd placement/element is 99
+ varZ[0] = -99; //assigning varZ so that the 1st placement is -99
PrintFunction(varX, varY, varZ);
return 0;