diff options
| author | Andrei F <[email protected]> | 2022-10-19 21:04:51 -0700 |
|---|---|---|
| committer | Andrei F <[email protected]> | 2022-10-19 21:04:51 -0700 |
| commit | 22dfff41c7660a59f069af42d57c93f8939ff2c0 (patch) | |
| tree | 5ea7a48467fe899493e92c0173a4957392edfedd | |
| parent | Finished exercise 3 and 4 (diff) | |
| download | cst116-ch9-debugging-florea-22dfff41c7660a59f069af42d57c93f8939ff2c0.tar.xz cst116-ch9-debugging-florea-22dfff41c7660a59f069af42d57c93f8939ff2c0.zip | |
| -rw-r--r-- | CST116-Ch9-Debugging-Florea.txt | 7 | ||||
| -rw-r--r-- | CST116-Ch9-Debugging/CST116-Ch9-Debugging-Florea.cpp (renamed from CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp) | 0 | ||||
| -rw-r--r-- | CST116-Ch9-Florea-pseudo-code.txt | 34 |
3 files changed, 41 insertions, 0 deletions
diff --git a/CST116-Ch9-Debugging-Florea.txt b/CST116-Ch9-Debugging-Florea.txt new file mode 100644 index 0000000..c29f0f0 --- /dev/null +++ b/CST116-Ch9-Debugging-Florea.txt @@ -0,0 +1,7 @@ +/Users/andreiflorea/Desktop/Code/Oregon_Tech/cst116-ch9-debugging-florea/cmake-build-debug/cst116_ch9_debugging_florea +Please enter your age: 19 +19! Boy are you old! +Did you know that you are at least 6935 days old? + + +Process finished with exit code 0 diff --git a/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp b/CST116-Ch9-Debugging/CST116-Ch9-Debugging-Florea.cpp index 52afd58..52afd58 100644 --- a/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp +++ b/CST116-Ch9-Debugging/CST116-Ch9-Debugging-Florea.cpp diff --git a/CST116-Ch9-Florea-pseudo-code.txt b/CST116-Ch9-Florea-pseudo-code.txt new file mode 100644 index 0000000..0432af4 --- /dev/null +++ b/CST116-Ch9-Florea-pseudo-code.txt @@ -0,0 +1,34 @@ +variable DAYS_PER_YEAR = 365 + +declare function GetAge +declare function CalcDays +declare function PrintResults + + +function main + variable age = 0 + variable days = 0 + + age = call function GetAge() + days = call function CalcDays(pass in age) + + call function PrintResults(pass in days, pass in age) + +function GetAge + variable age + + display "Please enter your age" + take the input and store it in age + + return age + +function CalcDays( parameter years (give the variable age)) + variable days + + days = years * DAYS_PER_YEAR + + return days + +function PrintResults(parameter days, parameter age) + display variable age + "! Boy are you old" + display "Did you know you are at least" + variable days + " days old?"
\ No newline at end of file |