From 23c121c069d1b4f6878f3920d47395aabccc8dbf Mon Sep 17 00:00:00 2001 From: Morgan Cyrus Date: Wed, 12 Oct 2022 20:18:15 -0700 Subject: Fixed age 1 problem. --- CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp') 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; -- cgit v1.2.3