From edf8ed43afaf5665feee5a07eef04a8353b2fbf4 Mon Sep 17 00:00:00 2001 From: Taylor Rogers Date: Wed, 19 Oct 2022 19:25:49 -0700 Subject: Changed code --- CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (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 7518b67..1462981 100644 --- a/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp +++ b/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp @@ -89,8 +89,7 @@ using std::cin; using std::endl; const int DAYS_PER_YEAR = 365; -int age; -int days; + int GetAge(); int CalcDays(int age); @@ -99,12 +98,12 @@ void PrintResults(int age, int days); int main() { - // int age = 0; - // int days = 0; + int age = 0; + int days = 0; // Breakpoint 1 // Put breakpoint on the following line - GetAge(); + age = GetAge(); days = CalcDays(age); // Breakpoint 2 @@ -115,6 +114,7 @@ int main() } int GetAge() { + int age; cout << "Please enter your age: "; cin >> age; @@ -123,7 +123,7 @@ int GetAge() } int CalcDays(int years) { - + int days; days = years * DAYS_PER_YEAR; -- cgit v1.2.3