diff options
Diffstat (limited to 'CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp')
| -rw-r--r-- | CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp b/CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp index d395096..d9cdd8a 100644 --- a/CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp +++ b/CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp @@ -42,6 +42,10 @@ * 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"?
+*
+* -There was a colon after the else terminating the line making the last condition met the (child) print
+* and output "adult" simply because it is an output command independant of the ended else statement-
+*
* 4) Re-run the program this time with debugging and run to
* Breakpoint 2.
* 5) Why is the action with the else executing?
@@ -74,7 +78,7 @@ int main() else if (age > 62)
cout << "Senior" << endl;
-
+
// Breakpoint 2
// Put a breakpoint on the following line
else
|