From 0cb411e179b5bc88e72977d74f02bb15bffe91c0 Mon Sep 17 00:00:00 2001 From: Joe Traver Date: Tue, 11 Oct 2022 21:16:29 -0700 Subject: Finished all questions and program corrections --- CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp | 6 +++++- 1 file changed, 5 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 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 -- cgit v1.2.3