aboutsummaryrefslogtreecommitdiff
path: root/CST116-Ch9-Debugging/CST116-Ch9-Debugging-Williams-PSEUDOCODE.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CST116-Ch9-Debugging/CST116-Ch9-Debugging-Williams-PSEUDOCODE.txt')
-rw-r--r--CST116-Ch9-Debugging/CST116-Ch9-Debugging-Williams-PSEUDOCODE.txt25
1 files changed, 25 insertions, 0 deletions
diff --git a/CST116-Ch9-Debugging/CST116-Ch9-Debugging-Williams-PSEUDOCODE.txt b/CST116-Ch9-Debugging/CST116-Ch9-Debugging-Williams-PSEUDOCODE.txt
new file mode 100644
index 0000000..fd605d0
--- /dev/null
+++ b/CST116-Ch9-Debugging/CST116-Ch9-Debugging-Williams-PSEUDOCODE.txt
@@ -0,0 +1,25 @@
+begin
+create constant DAYS_PER_YEAR and set it to 365
+create AGE and DAYS and set them both to 0
+run GETAGE and pass its result to AGE
+run CALCDAYS(AGE) and pass its result to DAYS
+run PRINTRESULTS(AGE,DAYS)
+end
+
+GETAGE:
+create local AGE
+print "Please enter your age: "
+get input and pass it to local AGE
+return local AGE
+end
+
+CALCDAYS(YEARS):
+create local DAYS
+set DAYS to YEARS * DAYS_PER_YEAR
+return DAYS
+end
+
+PRINTRESULTS(AGE,DAYS)
+print "{AGE}! Boy are you old!\n"
+print "Did you know that you are at least {DAYS} years old?\n\n"
+end \ No newline at end of file