aboutsummaryrefslogtreecommitdiff
path: root/CST116-Ch9-Debugging
diff options
context:
space:
mode:
authorTheOtherTonyStark <[email protected]>2022-10-16 14:08:34 -0700
committerTheOtherTonyStark <[email protected]>2022-10-16 14:08:34 -0700
commit2b9c6225a968533d5da195f72e0854cb97f79dcb (patch)
treefeeebfb1faa10a77f74738fcf1bd82b8f10e9bd6 /CST116-Ch9-Debugging
parentThird Commit (diff)
downloadcst116-ch9-debugging-theothertonystark-2b9c6225a968533d5da195f72e0854cb97f79dcb.tar.xz
cst116-ch9-debugging-theothertonystark-2b9c6225a968533d5da195f72e0854cb97f79dcb.zip
Fourth Commit
Diffstat (limited to 'CST116-Ch9-Debugging')
-rw-r--r--CST116-Ch9-Debugging/CST116-Ch9-Debugging-Chambers.cpp3
-rw-r--r--CST116-Ch9-Debugging/CST116-Ch9-Debugging-Solution.txt7
2 files changed, 9 insertions, 1 deletions
diff --git a/CST116-Ch9-Debugging/CST116-Ch9-Debugging-Chambers.cpp b/CST116-Ch9-Debugging/CST116-Ch9-Debugging-Chambers.cpp
index 425444a..ddabfe4 100644
--- a/CST116-Ch9-Debugging/CST116-Ch9-Debugging-Chambers.cpp
+++ b/CST116-Ch9-Debugging/CST116-Ch9-Debugging-Chambers.cpp
@@ -51,6 +51,7 @@
* 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 variables changed because we changed the order in which they were entered.
* 7) Stop debugging and fix the error.
*
* Debugging Exercise 4
@@ -106,7 +107,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/CST116-Ch9-Debugging-Solution.txt b/CST116-Ch9-Debugging/CST116-Ch9-Debugging-Solution.txt
index e69de29..2bedd5a 100644
--- a/CST116-Ch9-Debugging/CST116-Ch9-Debugging-Solution.txt
+++ b/CST116-Ch9-Debugging/CST116-Ch9-Debugging-Solution.txt
@@ -0,0 +1,7 @@
+Please enter your age: 29
+29! Boy are you old!
+Did you know that you are at least 10585 days old?
+
+
+C:\Users\cccha\Source\Repos\cst116-ch9-debugging-TheOtherTonyStark\CST116-Ch9-Debugging\x64\Debug\CST116-Ch9-Debugging-Chambers.exe (process 22104) exited with code 29.
+To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops. \ No newline at end of file