From 77562481d1413b8e70f68cad87698a9738b92718 Mon Sep 17 00:00:00 2001 From: Taylor Rogers Date: Sat, 8 Oct 2022 14:58:05 -0700 Subject: Answered exercise 3 Q3 --- CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp | 3 +++ 1 file changed, 3 insertions(+) (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 10862be..312dcf8 100644 --- a/CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp +++ b/CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp @@ -48,6 +48,9 @@ * 1) Run the program without debugging. * 2) When prompted, enter the value of 10 for your age. * 3) Why does the program print both "Child" and "Adult"? +* +* the semicolon after "else" is ending the statement, so the "cout" on the next line is not conditional and prints every time the program is run. +* * 4) Re-run the program this time with debugging and run to * Breakpoint 2. * 5) Why is the action with the else executing? -- cgit v1.2.3