aboutsummaryrefslogtreecommitdiff
path: root/CST116-Ch9-Debugging-Ahmed/CST116-Ch9-Debugging-Ahmed.cpp
diff options
context:
space:
mode:
authorMusa Ahmed <[email protected]>2022-10-19 13:25:36 -0700
committerMusa Ahmed <[email protected]>2022-10-19 13:25:36 -0700
commit42717cae743c96bb43999576b68c0f59e6b14ab5 (patch)
tree5f2809ec0e760647b10653324db89737eee293d8 /CST116-Ch9-Debugging-Ahmed/CST116-Ch9-Debugging-Ahmed.cpp
parentrename (diff)
downloadcst116-ch9-debugging-m005a-42717cae743c96bb43999576b68c0f59e6b14ab5.tar.xz
cst116-ch9-debugging-m005a-42717cae743c96bb43999576b68c0f59e6b14ab5.zip
did debugging exercises
Diffstat (limited to 'CST116-Ch9-Debugging-Ahmed/CST116-Ch9-Debugging-Ahmed.cpp')
-rw-r--r--CST116-Ch9-Debugging-Ahmed/CST116-Ch9-Debugging-Ahmed.cpp5
1 files changed, 4 insertions, 1 deletions
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";