From bf41b0ce1324eb5b4f301e8f9cf3a1e784f3be69 Mon Sep 17 00:00:00 2001 From: Anibal LopezBonilla Date: Thu, 6 Oct 2022 18:53:52 -0700 Subject: Push 1 --- CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp | 5 ++++- 1 file changed, 4 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 f64adfe..cf110a7 100644 --- a/CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp +++ b/CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp @@ -13,6 +13,9 @@ * the value in age is what you typed in. * 5) Step over the if statement. * 6) Why did the value in age change? +* +* ANS: Because there is only one equal sign in the if statement +* * 7) Fix the problem and repeat Steps 2 – 5 to verify the * problem was corrected. * 8) Stop debugging. @@ -56,7 +59,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