diff options
Diffstat (limited to 'CST116-Ch9-Florea-pseudo-code.txt')
| -rw-r--r-- | CST116-Ch9-Florea-pseudo-code.txt | 34 |
1 files changed, 34 insertions, 0 deletions
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 |