Choosing a design method: structure diagram, flowchart or pseudocode

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Choosing a design method: structure diagram, flowchart or pseudocode

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Which method shows a solution broken down into its parts (sub-systems) as boxes?
A Structure diagram
B Flowchart
2. Which method draws the steps of an algorithm as a picture using symbols and arrows?
A Structure diagram
B Flowchart
3. Which method writes the steps of an algorithm as text that looks close to real code?
A Pseudocode
B Structure diagram
4. A school system has parts called Login, Marks and Reports. Which method do you use FIRST?
A Pseudocode
B Structure diagram
5. You have a structure diagram with a box called Calculate Total. What do you do next for that box?
A Write an algorithm for it as a flowchart or pseudocode
B Draw another structure diagram of the whole system

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1Structure diagram AFOR Count ← 1 TO 5 OUTPUT Count NEXT Count
2Flowchart BThe order is wrong. The structure diagram must be drawn first to find the parts, then an algorithm is written for each box.
3Pseudocode is a text-based method that reads close to real code, so it shows the steps of an algorithm in order CShows the parts of a solution as boxes, split from the main problem into sub-problems. Draw it first.
4A structure diagram splits a program into sub-problems, so each box can then be given its own algorithm DA structure diagram shows the parts of a solution, not the order of steps. A flowchart or pseudocode shows the steps in order.
5Use a structure diagram to show the exact order of each step inside a loop EQuiz Program -> Ask Question | Mark Answer | Show Score
6Write the pseudocode for every box first, then draw the structure diagram last FA picture of the steps of an algorithm in order, using shapes joined by arrows.

Definitions

structure diagram

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
_________ ShowResult() OUTPUT "Well done" ENDPROCEDURE
2.
____ GetMarks() CALL CalcTotal() CALL ShowTotal()
3.
Total _ Mark1 + Mark2 Average ← Total / 2 OUTPUT Average
4.
IF Mark >= 50 ____ OUTPUT "Pass" ENDIF
5.
FOR Count ← 1 __ 5 OUTPUT Count NEXT Count

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A FUNCTION ShowMenu()
B OUTPUT "Menu"
C ENDPROCEDURE
Question 2
A PROCEDURE GetMarks()
B INPUT Maths
C INPUT English
D Total = Maths + English
E ENDPROCEDURE
Question 3
A INPUT Name
B INPUT Score
C PRINT Name, Score
Question 4
A FOR Count ← 1 UNTIL 5
B OUTPUT Count
C NEXT Count
Question 5
A INPUT Age
B OUTPUT "Checking age"
C IF Age ← 16 THEN
D OUTPUT "Can apply"
E ENDIF

Answer Key

Choosing a design method: structure diagram, flowchart or pseudocode
Section A: Quick Questions
Q1
A — Structure diagram
Q2
B — Flowchart
Q3
A — Pseudocode
Q4
B — Structure diagram
Q5
A — Write an algorithm for it as a flowchart or pseudocode
Section B: Match the Pairs
Q1
Structure diagram → Shows the parts of a solution as boxes, split from the main problem into sub-problems. Draw it first.
Q2
Flowchart → A picture of the steps of an algorithm in order, using shapes joined by arrows.
Q3
Pseudocode is a text-based method that reads close to real code, so it shows the steps of an algorithm in order → FOR Count ← 1 TO 5 OUTPUT Count NEXT Count
Q4
A structure diagram splits a program into sub-problems, so each box can then be given its own algorithm → Quiz Program -> Ask Question | Mark Answer | Show Score
Q5
Use a structure diagram to show the exact order of each step inside a loop → A structure diagram shows the parts of a solution, not the order of steps. A flowchart or pseudocode shows the steps in order.
Q6
Write the pseudocode for every box first, then draw the structure diagram last → The order is wrong. The structure diagram must be drawn first to find the parts, then an algorithm is written for each box.
Section C: Definitions
Q1
structure diagram — Shows the parts of a solution as boxes. Flowcharts (pictures) and pseudocode (text) then show the steps of each box in order. Draw the structure diagram first.
Section D: Fill in the Blanks
Q1
PROCEDURE ShowResult() OUTPUT "Well done" ENDPROCEDURE
Q2
CALL GetMarks() CALL CalcTotal() CALL ShowTotal()
Q3
Total ← Mark1 + Mark2 Average ← Total / 2 OUTPUT Average
Q4
IF Mark >= 50 THEN OUTPUT "Pass" ENDIF
Q5
FOR Count ← 1 TO 5 OUTPUT Count NEXT Count
Section E: Spot the Error
Q1
A — The block ends with ENDPROCEDURE, so it must start with PROCEDURE ShowMenu(). A subroutine that only outputs and returns no value is a procedure, not a function.
Q2
D — In Cambridge pseudocode, assignment uses the arrow ←, not =. The line should be Total ← Maths + English.
Q3
C — Cambridge pseudocode uses the keyword OUTPUT to display values, not PRINT. The line should be OUTPUT Name, Score.
Q4
A — A FOR loop sets its range with TO. UNTIL belongs to REPEAT loops. The line should be FOR Count ← 1 TO 5.
Q5
C — The condition must compare values, not assign one. It should be IF Age >= 16 THEN. The arrow ← is only for assignment.