aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaylor Rogers <[email protected]>2022-10-11 08:20:36 -0700
committerTaylor Rogers <[email protected]>2022-10-11 08:20:36 -0700
commit4c6fe88f9f25c26981cab2a3dcc056ffcae78f67 (patch)
tree6ac824508598fca17a19f545e287e4bb9bbd1ed1
parentAnswer E1 Q7 (diff)
downloadcst116-chapter8-debugging-taylorrog-4c6fe88f9f25c26981cab2a3dcc056ffcae78f67.tar.xz
cst116-chapter8-debugging-taylorrog-4c6fe88f9f25c26981cab2a3dcc056ffcae78f67.zip
Answer E2 Q3 and Q4
-rw-r--r--CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp b/CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp
index 5b029d2..539e115 100644
--- a/CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp
+++ b/CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp
@@ -29,8 +29,14 @@
* 1) Run to Breakpoint 1.
* 2) Step into the while loop.
* 3) Why did the cout not execute?
+*
+* Because I is not less than 0
+*
* 4) Check the value of i, now check the condition, does the
* condition evaluate to true?
+*
+* No, i = 0
+*
* 5) Change the "< 0" to a "< 10".
* 6) Stop debugging and repeat Steps 1 � 4 to verify the correction
* worked.
@@ -67,7 +73,7 @@ int main()
// Breakpoint 1
// Put a breakpoint on the following line
- while (i < 0);
+ while (i < 0)
cout << i << endl;
// Breakpoint 2