aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Pearse <[email protected]>2022-10-19 17:40:18 -0700
committerTim Pearse <[email protected]>2022-10-19 17:40:18 -0700
commit71a78d57dc1d7bd996a88507b2200fa4c9681874 (patch)
treee9ea91107bd4f4e22b0958a8126fbc2bd1da3da1
parentChange 1 : All of the debug exercises completed (diff)
downloadcst116-ch9-debugging-legokid1503-main.tar.xz
cst116-ch9-debugging-legokid1503-main.zip
Change 2 : added output and pseudocode files.HEADmain
-rw-r--r--CST116-Ch9-Debugging/CST116-Ch9-Pearse-Pseudocode.txt25
-rw-r--r--CST116-Ch9-Debugging/CST116-Ch9-Pearse.txt8
2 files changed, 33 insertions, 0 deletions
diff --git a/CST116-Ch9-Debugging/CST116-Ch9-Pearse-Pseudocode.txt b/CST116-Ch9-Debugging/CST116-Ch9-Pearse-Pseudocode.txt
new file mode 100644
index 0000000..c0b10e6
--- /dev/null
+++ b/CST116-Ch9-Debugging/CST116-Ch9-Pearse-Pseudocode.txt
@@ -0,0 +1,25 @@
+main(){
+ int age, days
+
+ age = getAge()
+ days = calcDays(age)
+
+ printResults(days, age)
+}
+
+int getAge(){
+ print("How old are you?")
+ int age
+ input(age)
+ return age
+}
+
+int calcDays(years){
+ int days = age * 365
+ return days
+}
+
+printResults(days, age){
+ print(age + "! Boy are you old!")
+ print("Did you know that you are at least " + days + " days old?")
+} \ No newline at end of file
diff --git a/CST116-Ch9-Debugging/CST116-Ch9-Pearse.txt b/CST116-Ch9-Debugging/CST116-Ch9-Pearse.txt
new file mode 100644
index 0000000..439dfce
--- /dev/null
+++ b/CST116-Ch9-Debugging/CST116-Ch9-Pearse.txt
@@ -0,0 +1,8 @@
+Please enter your age: 20
+20! Boy are you old!
+Did you know that you are at least 7300 days old?
+
+
+C:\Users\legok\Source\Repos\cst116-ch9-debugging-legokid1503\CST116-Ch9-Debugging\x64\Debug\CST116-Ch9-Debugging.exe (process 21112) exited with code 0.
+To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops.
+Press any key to close this window . . . \ No newline at end of file