diff options
| author | Taylor Rogers <[email protected]> | 2022-10-08 14:58:05 -0700 |
|---|---|---|
| committer | Taylor Rogers <[email protected]> | 2022-10-08 14:58:05 -0700 |
| commit | 77562481d1413b8e70f68cad87698a9738b92718 (patch) | |
| tree | 76de26bb22b309aa92fac93e317c8f5ad6da05f0 /CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp | |
| parent | Answered exercise 2 Q6 (diff) | |
| download | cst116-ch7-debugging-taylorrog-77562481d1413b8e70f68cad87698a9738b92718.tar.xz cst116-ch7-debugging-taylorrog-77562481d1413b8e70f68cad87698a9738b92718.zip | |
Answered exercise 3 Q3
Diffstat (limited to 'CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp')
| -rw-r--r-- | CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
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?
|