Turning a structure diagram into a main flowchart and sub-flowcharts

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

Turning a structure diagram into a main flowchart and sub-flowcharts

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. In a main flowchart, how is each sub-problem from the structure diagram shown?
A As a diamond decision symbol
B As a subroutine symbol (rectangle with double side lines) that calls it
2. A structure diagram has 4 bottom-level boxes. How many separate sub-flowcharts do you draw?
A 4, one for each bottom-level box
B 1, which holds all of the boxes together
3. Which describes the main flowchart?
A A list of calls to the sub-problems, in order
B All the detailed steps of every sub-problem in one chart
4. What should the name inside a subroutine symbol match?
A The name of a box in the structure diagram
B A new name made up for the main flowchart
5. How does each sub-flowchart begin and end?
A It has no start or end, because the main flowchart controls it
B It starts with its sub-problem name and ends with an end terminator

Match the Pairs

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

Left columnRight column
1Subroutine symbol labelled Get Marks AA call in the main flowchart that runs the Get Marks sub-problem, which has its own separate flowchart
2Main flowchart: START, Get Marks, Calculate Grade, Show Result, END BBoxes: Get Marks, Calculate Grade, Show Result -> Flowcharts: Get Marks, Calculate Grade, Show Result
3Every bottom-level box in the structure diagram needs its own flowchart CBox Show Result -> symbol Show Result in main -> flowchart Show Result drawn, tick
4Check that every box has been drawn by matching each box to a subroutine symbol and a sub-flowchart DOne bottom-level box has no flowchart, so the solution is incomplete and that sub-problem is never solved
5Main flowchart: START, rectangle Get Marks, rectangle Calculate Grade, END EA main flowchart that is only a list of calls, one subroutine symbol per sub-problem, in order
6Structure diagram has 3 bottom boxes but only 2 sub-flowcharts are drawn FThe sub-problems are drawn as ordinary process rectangles instead of subroutine symbols, so they are not calls to separate flowcharts

Definitions

main flowchart

Fill in the Blanks

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

1.
Structure box: CalcAverage Main flowchart: ____ CalcAverage
2.
Bottom-level box: ShowResult Main flowchart: CALL __________
3.
Bottom boxes: GetMarks, CalcAvg, ShowResult Sub-flowcharts to draw: _
4.
Sub-flowchart for the box GetMarks: It has its own _____ and END ovals
5.
Boxes: GetMarks, CalcAvg, ShowResult Main calls: GetMarks, _______, ShowResult

Spot the Error

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

Question 1
A ( START )
B [| GetQuestions |]
C [ MarkAnswers ]
D [| ShowScore |]
E ( END )
Question 2
A ( GetMarks )
B / INPUT mark /
C [ total ← total + mark ]
D ( START )
Question 3
A ( END )
B [| ReadTemp |]
C [| FindAverage |]
D ( END )
Question 4
A ( START )
B [| ReadMarks |]
C <> mark >= 50 ?
D [| PrintReport |]
E ( END )
Question 5
A [ START ]
B [| ReadTemps |]
C [| FindHottest |]
D ( END )

Answer Key

Turning a structure diagram into a main flowchart and sub-flowcharts
Section A: Quick Questions
Q1
B — As a subroutine symbol (rectangle with double side lines) that calls it
Q2
A — 4, one for each bottom-level box
Q3
A — A list of calls to the sub-problems, in order
Q4
A — The name of a box in the structure diagram
Q5
B — It starts with its sub-problem name and ends with an end terminator
Section B: Match the Pairs
Q1
Subroutine symbol labelled Get Marks → A call in the main flowchart that runs the Get Marks sub-problem, which has its own separate flowchart
Q2
Main flowchart: START, Get Marks, Calculate Grade, Show Result, END → A main flowchart that is only a list of calls, one subroutine symbol per sub-problem, in order
Q3
Every bottom-level box in the structure diagram needs its own flowchart → Boxes: Get Marks, Calculate Grade, Show Result -> Flowcharts: Get Marks, Calculate Grade, Show Result
Q4
Check that every box has been drawn by matching each box to a subroutine symbol and a sub-flowchart → Box Show Result -> symbol Show Result in main -> flowchart Show Result drawn, tick
Q5
Main flowchart: START, rectangle Get Marks, rectangle Calculate Grade, END → The sub-problems are drawn as ordinary process rectangles instead of subroutine symbols, so they are not calls to separate flowcharts
Q6
Structure diagram has 3 bottom boxes but only 2 sub-flowcharts are drawn → One bottom-level box has no flowchart, so the solution is incomplete and that sub-problem is never solved
Section C: Definitions
Q1
main flowchart — A flowchart that calls each sub-problem from the structure diagram with a subroutine symbol. Each sub-problem then gets its own separate flowchart.
Section D: Fill in the Blanks
Q1
Structure box: CalcAverage Main flowchart: CALL CalcAverage
Q2
Bottom-level box: ShowResult Main flowchart: CALL ShowResult
Q3
Bottom boxes: GetMarks, CalcAvg, ShowResult Sub-flowcharts to draw: 3
Q4
Sub-flowchart for the box GetMarks: It has its own START and END ovals
Q5
Boxes: GetMarks, CalcAvg, ShowResult Main calls: GetMarks, CalcAvg, ShowResult
Section E: Spot the Error
Q1
C — In the main flowchart every bottom-level box from the structure diagram is called with the subroutine symbol (a rectangle with double side lines). A plain process rectangle is wrong, so line 3 should be [| MarkAnswers |].
Q2
D — The sub-flowchart for the GetMarks box must finish with an end terminator. Line 4 should be ( END ), not a second start.
Q3
A — A main flowchart must begin with a start terminator. Line 1 should be ( START ), because the main flowchart only ends on the last line.
Q4
C — The main flowchart should only be a list of subroutine calls. A decision like this belongs inside the CalcGrade sub-flowchart. Line 3 should be [| CalcGrade |].
Q5
A — Start and end must be drawn as terminator (rounded) shapes. A process rectangle is the wrong shape. Line 1 should be ( START ).