From 5fbdaa1b63aae7f4d1c17b8ff69d0d9c194bc499 Mon Sep 17 00:00:00 2001 From: prestonderek Date: Tue, 18 Oct 2022 10:25:07 -0700 Subject: Exercise 3 complete --- CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp') diff --git a/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp b/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp index 3b560fb..831faf3 100644 --- a/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp +++ b/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp @@ -68,6 +68,10 @@ //in exercise 2, age is greyed out in the watch window because in the calcdays function it is considered a constant. +//exercise 3: when entering into the print function, the variables are flipped. + //Variables have to be in the correct order so that they print in the correct order. + //It will assign the first value called to the first value in the function + #include using std::cout; using std::cin; @@ -112,7 +116,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"; -- cgit v1.2.3