diff options
Diffstat (limited to 'CST116-Ch9-Debugging/CST116-Ch9-Debugging-Preston-Pseduocode.txt')
| -rw-r--r-- | CST116-Ch9-Debugging/CST116-Ch9-Debugging-Preston-Pseduocode.txt | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/CST116-Ch9-Debugging/CST116-Ch9-Debugging-Preston-Pseduocode.txt b/CST116-Ch9-Debugging/CST116-Ch9-Debugging-Preston-Pseduocode.txt new file mode 100644 index 0000000..0dd3c0a --- /dev/null +++ b/CST116-Ch9-Debugging/CST116-Ch9-Debugging-Preston-Pseduocode.txt @@ -0,0 +1,36 @@ +Pseudocode for Ch9 Debugging + +constant int daysperyear = 365 + +function getage +function calcdays(age) +void function printresults(age, days) + +main function begin + int age = 0 + int days = 0 + + age = getage + + days = calcdays(age) + + printresults(age, days) + +getage function begin + int age + + print "Please enter your age: " + input age + + return age + +calcdays function begin (int years) + int days + + days = years * daysperyear + + return days + +printresults function begin + print age + "! Boy you are old!" *new line + print "Did you know that you are at least " + days + " days old?" *new line
\ No newline at end of file |