aboutsummaryrefslogtreecommitdiff
path: root/CST116-Ch9-Debugging/CST116-Ch9-Havaldar.cpp
diff options
context:
space:
mode:
authorDoolyBoi <[email protected]>2022-10-19 14:16:24 -0700
committerDoolyBoi <[email protected]>2022-10-19 14:16:24 -0700
commit41a0e4b3812d36e21ea2fe5e27fc7c1fb9d20d01 (patch)
tree55d460d2002ae8084f463df7964d6053519a4482 /CST116-Ch9-Debugging/CST116-Ch9-Havaldar.cpp
parentMerge branch 'main' of https://github.com/CST116/cst116-ch9-debugging-abd00l4h (diff)
downloadcst116-ch9-debugging-abd00l4h-41a0e4b3812d36e21ea2fe5e27fc7c1fb9d20d01.tar.xz
cst116-ch9-debugging-abd00l4h-41a0e4b3812d36e21ea2fe5e27fc7c1fb9d20d01.zip
debugging exercise 1 fix
Diffstat (limited to 'CST116-Ch9-Debugging/CST116-Ch9-Havaldar.cpp')
-rw-r--r--CST116-Ch9-Debugging/CST116-Ch9-Havaldar.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/CST116-Ch9-Debugging/CST116-Ch9-Havaldar.cpp b/CST116-Ch9-Debugging/CST116-Ch9-Havaldar.cpp
index 3c029bc..af98762 100644
--- a/CST116-Ch9-Debugging/CST116-Ch9-Havaldar.cpp
+++ b/CST116-Ch9-Debugging/CST116-Ch9-Havaldar.cpp
@@ -75,15 +75,15 @@ const int DAYS_PER_YEAR = 365;
int GetAge();
int CalcDays(int age);
void PrintResults(int age, int days);
-int age = 0;
-int days = 0;
int main()
{
+ int age = 0;
+ int days = 0;
// Breakpoint 1
// Put breakpoint on the following line
- GetAge();
+ age = GetAge();
days = CalcDays(age);
// Breakpoint 2
@@ -94,7 +94,8 @@ int main()
}
int GetAge()
{
-
+ int age;
+
cout << "Please enter your age: ";
cin >> age;