aboutsummaryrefslogtreecommitdiff
path: root/CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp
diff options
context:
space:
mode:
authorMorgan Cyrus <[email protected]>2022-10-12 20:18:15 -0700
committerMorgan Cyrus <[email protected]>2022-10-12 20:18:15 -0700
commit23c121c069d1b4f6878f3920d47395aabccc8dbf (patch)
treeed2e3eb3ab8b7070d46e9c03a4b42ba3f277b4e9 /CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp
parentLooking for issue with code (diff)
downloadcst116-ch7-cyrus-23c121c069d1b4f6878f3920d47395aabccc8dbf.tar.xz
cst116-ch7-cyrus-23c121c069d1b4f6878f3920d47395aabccc8dbf.zip
Fixed age 1 problem.
Diffstat (limited to 'CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp')
-rw-r--r--CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp b/CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp
index 9f6082c..fe6e040 100644
--- a/CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp
+++ b/CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp
@@ -23,9 +23,14 @@
* Done; age now == 1
*
* 6) Why did the value in age change?
+* It was assigning 1 to age rather than comparing the value = vs ==
+*
* 7) Fix the problem and repeat Steps 2 � 5 to verify the
* problem was corrected.
+* Corrected and verified.
+*
* 8) Stop debugging.
+* done
*
* Debugging Exercise 2
*
@@ -66,7 +71,7 @@ int main()
// Breakpoint 1
// Put a breakpoint on the following line
- if (age = 1)
+ if (age == 1)
cout << "First Birthday" << endl;
else if (age >= 12 || age <= 19)
cout << "Teenager" << endl;