Big Idea 3 · Topic 3.13 · Exercise 1
Trace the Procedures
25 minutes
Back to the Topic 3.13 lessonAll CSP topics
How this page works
The writing boxes below are yours. What you type stays in this browser, is saved here as you go, and is never sent to us or to your teacher. Hand the written work in the way your teacher asked for it.
The graded check at the bottom is the part that records to your teacher's gradebook.
Part B, from your handoutNot recorded
Your handout says these are the same items available here. Part A stays on paper.
Q1 · 3 points on the handout
Write your own short procedure (in exam pseudocode) that uses an early RETURN as a guard - for example, returns a fixed value for a special input before doing the main calculation. Show two calls: one that hits the guard and one that does not, and give each returned value.
Q2 · 3 points on the handout
Explain the difference between a procedure that ends with DISPLAY(total) and one that ends with RETURN(total). Give one situation where only the RETURN version works, and say why.
Q3 · 2 points on the handout
ENRICHMENT: The store program is being split so that validating input, computing totals, and formatting labels each become their own procedure. Name the CED term for this subdivision and explain one way it makes the program easier for a human to read.
Q4 · 0 points on the handout
Next step: you traced these procedures by hand. Now head to the Topic 3.13 page and type and run the harder versions, where the computer checks your output for you.
No graded check on this page yetNot recorded
About the line in your handout
Your handout says this exercise is available online and auto-graded. The exercise IS here, and it is the same work in the same order, but the auto-graded half is not written for this topic yet. Nothing on this page is scored or sent to your teacher.
Hand this in the way your teacher asked for it. Topic 1.1 has its graded check today, and the rest follow.