aboutsummaryrefslogtreecommitdiff
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
parentrename (diff)
downloadcst116-ch9-debugging-m005a-42717cae743c96bb43999576b68c0f59e6b14ab5.tar.xz
cst116-ch9-debugging-m005a-42717cae743c96bb43999576b68c0f59e6b14ab5.zip
did debugging exercises
-rw-r--r--CST116-Ch9-Debugging-Ahmed/CST116-Ch9-Debugging-Ahmed.cpp5
-rw-r--r--CST116-Ch9-Debugging-Ahmed/CST116-Ch9-Debugging-Ahmed.vcxproj2
-rw-r--r--CST116-Ch9-Debugging-Ahmed/CST116-Ch9-Debugging-Ahmed.vcxproj.filters2
3 files changed, 6 insertions, 3 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";
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 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
- <ClCompile Include="CST116-Ch9-Debugging.cpp" />
+ <ClCompile Include="CST116-Ch9-Debugging-Ahmed.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
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 @@
</Filter>
</ItemGroup>
<ItemGroup>
- <ClCompile Include="CST116-Ch9-Debugging.cpp">
+ <ClCompile Include="CST116-Ch9-Debugging-Ahmed.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>