From 42717cae743c96bb43999576b68c0f59e6b14ab5 Mon Sep 17 00:00:00 2001 From: Musa Ahmed Date: Wed, 19 Oct 2022 13:25:36 -0700 Subject: did debugging exercises --- CST116-Ch9-Debugging-Ahmed/CST116-Ch9-Debugging-Ahmed.cpp | 5 ++++- CST116-Ch9-Debugging-Ahmed/CST116-Ch9-Debugging-Ahmed.vcxproj | 2 +- .../CST116-Ch9-Debugging-Ahmed.vcxproj.filters | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'CST116-Ch9-Debugging-Ahmed') diff --git a/CST116-Ch9-Debugging-Ahmed/CST116-Ch9-Debugging-Ahmed.cpp b/CST116-Ch9-Debugging-Ahmed/CST116-Ch9-Debugging-Ahmed.cpp index 4182b54..beb37f6 100644 --- a/CST116-Ch9-Debugging-Ahmed/CST116-Ch9-Debugging-Ahmed.cpp +++ b/CST116-Ch9-Debugging-Ahmed/CST116-Ch9-Debugging-Ahmed.cpp @@ -40,6 +40,7 @@ * 4) Step into one more time so that the current line is the * calculation. * 5) Why is age greyed out in your watch window? +* It's not greyed out. I followed every step but its not greyed out for me * 6) Stop debugging. * * Debugging Exercise 3 @@ -51,6 +52,8 @@ * 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? +* in the function we have the order for age and days reversed, reversing them fixes +* the error * 7) Stop debugging and fix the error. * * Debugging Exercise 4 @@ -109,7 +112,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"; diff --git a/CST116-Ch9-Debugging-Ahmed/CST116-Ch9-Debugging-Ahmed.vcxproj b/CST116-Ch9-Debugging-Ahmed/CST116-Ch9-Debugging-Ahmed.vcxproj index d6f7f27..03b8aa4 100644 --- a/CST116-Ch9-Debugging-Ahmed/CST116-Ch9-Debugging-Ahmed.vcxproj +++ b/CST116-Ch9-Debugging-Ahmed/CST116-Ch9-Debugging-Ahmed.vcxproj @@ -127,7 +127,7 @@ - + diff --git a/CST116-Ch9-Debugging-Ahmed/CST116-Ch9-Debugging-Ahmed.vcxproj.filters b/CST116-Ch9-Debugging-Ahmed/CST116-Ch9-Debugging-Ahmed.vcxproj.filters index 701b0e5..08d805a 100644 --- a/CST116-Ch9-Debugging-Ahmed/CST116-Ch9-Debugging-Ahmed.vcxproj.filters +++ b/CST116-Ch9-Debugging-Ahmed/CST116-Ch9-Debugging-Ahmed.vcxproj.filters @@ -15,7 +15,7 @@ - + Source Files -- cgit v1.2.3