aboutsummaryrefslogtreecommitdiff
path: root/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp
diff options
context:
space:
mode:
authoralexandra-apetroaei <andra@MSI>2022-10-19 13:34:58 -0800
committeralexandra-apetroaei <andra@MSI>2022-10-19 13:34:58 -0800
commit4a21b2a833d07c47b477b78a27fd5390e4779b19 (patch)
tree71ace1673c0fe122e288af9aaa6c9d15e0b458e9 /CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp
parentIgrnore final I'm still working (diff)
downloadcst116-ch9-debugging-alexandra-apetroaei-4a21b2a833d07c47b477b78a27fd5390e4779b19.tar.xz
cst116-ch9-debugging-alexandra-apetroaei-4a21b2a833d07c47b477b78a27fd5390e4779b19.zip
This one is the finished product with the finished pusedo code!HEADmain
Diffstat (limited to 'CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp')
-rw-r--r--CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp b/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp
index 0cb38a8..75a69ee 100644
--- a/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp
+++ b/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp
@@ -77,13 +77,11 @@ int main()
{
int age = 0;
int days = 0;
- int years = 0;
-
// Breakpoint 1
// Put breakpoint on the following line
- GetAge();
- int days = CalcDays( age);
+ age = GetAge();
+ days = CalcDays( age);
// Breakpoint 2
// Put breakpoint on the following line
@@ -95,7 +93,7 @@ int GetAge()
{
int age;
- cout << "Please enter your age: " << endl;
+ cout << "Please enter your age: ";
cin >> age;
return age;
@@ -104,12 +102,12 @@ int CalcDays( int years)
{
int days;
- days = int years * const int DAYS_PER_YEAR;
+ days = years * DAYS_PER_YEAR;
return days;
}
void PrintResults(int age, int days)
{
- cout << age << " ! Boy are you old!" << endl ;
- cout << " Did you know that you are at least " << days << " days old?" << endl;
+ cout << age << " ! Boy are you old!\n" ;
+ cout << " Did you know that you are at least " << days << " days old?\n\n" ;
}