← QCE Digital Solutions Unit 3

Pseudocode for presenting results

A print statement that joins a label to a value so results are readable. Use headings, labels and one record per line, often inside a loop, to build a report.

Understanding Pseudocode for presenting results in QCE Digital Solutions Unit 3

What it does: The print inside the loop runs once for each record, so every record gets its own line. A label tells the reader what the number means. A bare value like total could be anything. The label and the variable must be joined with + so they print as one line of output. A heading is for readability only. It does not change how the program runs.

Common mistakes: The label and the variable are not joined. A + is needed between them: print "Name: " + name. Pseudocode uses the print keyword to display a heading. It should be print "=== Sales Report ===".

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 194–250) and word search (Modules 194–337).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Which print statement gives the user a clearer, labelled result?
print "Total: " + totalprint total
Matches
print "Total: " total
↓
The + joining the label and the variable is missing, so the label and value are not combined into one output
Applying
Meanings
Term
print "Total: " + total
Meaning
A print statement that joins a label to a value so results are readable. Use headings, labels and one record per line, often inside a loop, to build a report.
Practice
total ← 0
Testing
Gaps
"Total: " + total
Check Answer
Spots
1print "Student Report"
2print "Name: " name

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Giraffe' badge — High Perspective, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Which print statement gives the user a clearer, labelled result?
A. print total
B. print "Total: " + total ✓
A label tells the reader what the number means. A bare value like total could be anything.
2. A report lists 30 students. How should each student appear in the output?
A. All records joined together on one long line
B. One record per line, printed inside a loop ✓
One record per line keeps the report readable. A loop prints each record with the same print statement.
3. Where should the heading of a report be printed?
A. Before the loop, so it prints once ✓
B. Inside the loop, so it prints for every record
A heading appears once at the top. If it is inside the loop it repeats for every record.
4. Which pseudocode prints the grand total correctly after a report loop?
A. for i from 1 to 5 print names[i] next i print "Total: " + total ✓
B. print "Total: " + total for i from 1 to 5 print names[i] next i
Print the total after the loop ends, once all the values have been added up. Printing it first shows a total that is not finished.
5. Which line prints a labelled value on the same line?
A. print "Mark: " + mark ✓
B. print "Mark: " mark
The label and the variable must be joined with + so they print as one line of output.

Match the Pairs

print "Total: " + total → Shows a label followed by the value of total, so the result is easy to read
print "=== Class Report ===" → Prints a heading line at the top of a report
Print one record per line by putting the print statement inside a loop → for i from 1 to 5 print names[i] + ": " + marks[i] next i
Print the total once after the loop, so it appears at the end of the report → for i from 1 to 5 total <- total + marks[i] next i print "Total: " + total
print "Total: " total → The + joining the label and the variable is missing, so the label and value are not combined into one output
for i from 1 to 5 print "Report" print names[i] + ": " + marks[i] next i → The heading is printed inside the loop, so it repeats before every record instead of appearing once

Key Term

print "Total: " + total
A print statement that joins a label to a value so results are readable. Use headings, labels and one record per line, often inside a loop, to build a report.

Fill in the Blanks

1. print "Total: " + total
Hint: Type the keyword that displays a result to the user.
2. print "Total: " + total
Hint: Type the operator that joins the label text to the value.
3. for i from 1 to 5 print "Mark: " + marks[i] end for
Hint: Type the loop variable that picks out each item, so one record is printed per line.
4. average <- total / count print "Student Report" print "Average: " + average
Hint: Type the variable that holds the value shown after the label.
5. for i from 1 to count print names[i] + ": " + marks[i] end for
Hint: Type the keyword that starts a counted loop to print a line for each record.

Spot the Error

Question 1
A print "Student Report"
B print "Name: " name
C print "Mark: " + mark
Line B — The label and the variable are not joined. A + is needed between them: print "Name: " + name.
Question 2
A show "=== Sales Report ==="
B total <- 0
C print "Total: " + total
Line A — Pseudocode uses the print keyword to display a heading. It should be print "=== Sales Report ===".
Question 3
A for i from 1 to 3
B print "Pet " + i
C print pet[i] + ": " + age[1]
D end for
Line C — The age index is fixed at 1, so every line would show the first age. It should use the loop counter: age[i].
Question 4
A total <- 0
B for i from 1 to 3
C total <- mark[i]
D end for
E print "Total: " + total
Line C — This overwrites total each time round the loop instead of adding to it. It should be total <- total + mark[i], so the final total is correct.
Question 5
A print "Pet Ages"
B for i from 1 3
C print pet[i] + ": " + age[i]
D end for
Line B — The loop header is missing the keyword to. It should be for i from 1 to 3, so one record is printed per pass.

Student with a class code? Join your class →