aboutsummaryrefslogtreecommitdiff
path: root/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp
diff options
context:
space:
mode:
authorTaylor Rogers <[email protected]>2022-10-19 19:25:49 -0700
committerTaylor Rogers <[email protected]>2022-10-19 19:25:49 -0700
commitedf8ed43afaf5665feee5a07eef04a8353b2fbf4 (patch)
treee67850b5684c44343ce7e63193394085711fb9a8 /CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp
parentAdded pseudo code (diff)
downloadcst116-ch9-debugging-taylorrog-main.tar.xz
cst116-ch9-debugging-taylorrog-main.zip
Changed codeHEADmain
Diffstat (limited to 'CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp')
-rw-r--r--CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp12
1 files changed, 6 insertions, 6 deletions
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;