From 3e3a075a90d4e2ed5e1a7f7881f23d4e708f5f08 Mon Sep 17 00:00:00 2001 From: alexandra-apetroaei Date: Tue, 18 Oct 2022 17:47:19 -0800 Subject: added psuedocode --- CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 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 4234460..0cb38a8 100644 --- a/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp +++ b/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp @@ -63,7 +63,6 @@ ********************************************************************/ #include -using namespace std; using std::cout; using std::cin; using std::endl; @@ -71,7 +70,7 @@ using std::endl; const int DAYS_PER_YEAR = 365; int GetAge(); -void CalcDays(int age); +int CalcDays(int age); void PrintResults(int age, int days); int main() @@ -84,7 +83,7 @@ int main() // Breakpoint 1 // Put breakpoint on the following line GetAge(); - int days = CalcDays(age); + int days = CalcDays( age); // Breakpoint 2 // Put breakpoint on the following line @@ -96,21 +95,21 @@ int GetAge() { int age; - cout << "Please enter your age: "; + cout << "Please enter your age: " << endl; cin >> age; return age; } -void CalcDays(years) +int CalcDays( int years) { int days; - days = years * DAYS_PER_YEAR; + days = int years * const int DAYS_PER_YEAR; return days; } -void PrintResults(int days, int age) +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!" << endl ; + cout << " Did you know that you are at least " << days << " days old?" << endl; } -- cgit v1.2.3