From ecc366e1f67616d8d7c73fd7388b6b5cfc2279a3 Mon Sep 17 00:00:00 2001 From: Trenton Stark Date: Wed, 12 Oct 2022 20:54:57 -0700 Subject: completed exercise 1 --- CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp | 3 ++- 1 file changed, 2 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..19d0109 100644 --- a/CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp +++ b/CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp @@ -13,6 +13,7 @@ * the value in age is what you typed in. * 5) Step over the if statement. * 6) Why did the value in age change? +* By not using double equal signs, that was interpreted as changing age to 1 * 7) Fix the problem and repeat Steps 2 – 5 to verify the * problem was corrected. * 8) Stop debugging. @@ -56,7 +57,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