From 77bb95fc02da5b14dc323408597b963b4e9ac6aa Mon Sep 17 00:00:00 2001 From: jacobdw22 Date: Wed, 5 Oct 2022 16:22:49 -0700 Subject: simple changes --- CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (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..de19662 100644 --- a/CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp +++ b/CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp @@ -1,6 +1,6 @@ /******************************************************************** * File: CST116-Ch7-Debugging.cpp -* +* Jacob Wilson, CST116 * General Instructions: Complete each step before proceeding to the * next. * @@ -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? +* set = 1 set the age back to 1 * 7) Fix the problem and repeat Steps 2 – 5 to verify the * problem was corrected. * 8) Stop debugging. @@ -36,6 +37,7 @@ * 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 adult statement is not actually in the else statement. It is just a regular print statement. * 4) Re-run the program this time with debugging and run to * Breakpoint 2. * 5) Why is the action with the else executing? @@ -56,7 +58,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