aboutsummaryrefslogtreecommitdiff
path: root/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp
diff options
context:
space:
mode:
authorTaylor Rogers <[email protected]>2022-10-19 08:40:56 -0700
committerTaylor Rogers <[email protected]>2022-10-19 08:40:56 -0700
commit74cb0543ad50ba847d9bf36f6065c542371422fa (patch)
treea98c1cce8f5cb40eb3e5162aaf586a5730cbd4b1 /CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp
parentAnswered E2 Q5 (diff)
downloadcst116-ch9-debugging-taylorrog-74cb0543ad50ba847d9bf36f6065c542371422fa.tar.xz
cst116-ch9-debugging-taylorrog-74cb0543ad50ba847d9bf36f6065c542371422fa.zip
Answered E3 Q6
Diffstat (limited to 'CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp')
-rw-r--r--CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp b/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp
index f3d67a8..f116713 100644
--- a/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp
+++ b/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp
@@ -59,9 +59,15 @@
* 2) When asked, enter the value of 20 for your age.
* 3) Verify that the variable age is 20 and the variable days
* is 7300.
+*
+* Confirmed
+*
* 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?
+*
+* void PrintResults(int days, int age) should have age listed first. I changed it to void PrintResults(int age, int days) and it works.
+*
* 7) Stop debugging and fix the error.
*
* Debugging Exercise 4
@@ -120,7 +126,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";