From 3a5226c77692d4ffe8c05d333859be479a5f18e0 Mon Sep 17 00:00:00 2001 From: Trevor Bouchillon Date: Sun, 16 Oct 2022 15:39:26 -0700 Subject: exercise 3 done --- CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp') diff --git a/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp b/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp index d73e3a8..c5dbdb4 100644 --- a/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp +++ b/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp @@ -62,6 +62,9 @@ * 4) Step into the PrintResults function. * 5) Age is 7300? Not even Ralph is that old. * 6) Why did the values for both variables change? +* ***************************************************************************************************************** +* The values for both variables change because the print resuts function called them in the wrong order. +* ***************************************************************************************************************** * 7) Stop debugging and fix the error. * * Debugging Exercise 4 @@ -115,7 +118,7 @@ int CalcDays(int years) return days; } -void PrintResults(int days, int age) +void PrintResults(int age, int days) { cout << age << "! Boy are you old!\n"; cout << "Did you know that you are at least " << days << " days old?\n\n"; -- cgit v1.2.3