Subroutine symbol

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

Subroutine symbol

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Which shape is the flowchart subroutine symbol?
A A rectangle with extra vertical lines at each side
B A plain rectangle with no extra lines
2. What does the subroutine symbol show in a flowchart?
A A call to a procedure or function
B The start or end of the program
3. Where is the steps of the subroutine drawn?
A Inside the subroutine symbol itself
B As a separate, non-linked flowchart
4. What should be written inside the subroutine symbol?
A The word PROCESS
B The name of the subroutine, such as CalculateTotal
5. Which of these can the subroutine symbol represent?
A A function call and a procedure call
B A function call only

Match the Pairs

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

Left columnRight column
1A rectangle with extra vertical lines at each side, containing CalculateTotal AA rectangle with double side lines containing the name ShowMenu
2A rectangle with extra vertical lines at each side, containing PrintReport BA plain rectangle is a process symbol, so it does not show a subroutine call. It needs extra vertical lines at each side.
3A subroutine symbol stands for a call to a subroutine, so the name of the subroutine is written inside it. CA function call. The calculation is drawn as its own separate flowchart.
4The steps of a subroutine are not drawn inside the main flowchart. They are drawn as a separate, non-linked flowchart. DMain flowchart: subroutine symbol labelled CheckPassword. Second flowchart: START, CheckPassword steps, END
5A plain process rectangle (no extra side lines) containing a call to CalculateTotal EA procedure call. The steps of PrintReport are drawn as a separate flowchart.
6A subroutine symbol (rectangle with side lines) left empty, with the subroutine's steps drawn inside it as separate boxes FThe subroutine's name must be written inside the symbol. Its steps belong in a separate flowchart, not inside the symbol.

Definitions

Subroutine symbol

Fill in the Blanks

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

1.
____ ShowMenu()
2.
Total _ AddTax(Price)
3.
_________ ShowMenu() OUTPUT "Menu" ENDPROCEDURE
4.
FUNCTION Double(N : INTEGER) _______ INTEGER RETURN N * 2 ENDFUNCTION
5.
FUNCTION Double(N : INTEGER) RETURNS INTEGER ______ N * 2 ENDFUNCTION

Spot the Error

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

Question 1
A Terminator: START
B Process: Total ← 0
C Process: CalcTotal
D Terminator: END
Question 2
A Terminator: START
B Input: Num
C Subroutine: Num ← Num * 2
D Output: Num
Question 3
A PROCEDURE ShowMenu()
B RETURN "1 Play, 2 Quit"
C ENDPROCEDURE
Question 4
A Terminator: START
B Output: "1 Play, 2 Quit"
C Terminator: END
Question 5
A INPUT Score
B ShowGrade(Score)
C OUTPUT "Done"

Answer Key

Subroutine symbol
Section A: Quick Questions
Q1
A — A rectangle with extra vertical lines at each side
Q2
A — A call to a procedure or function
Q3
B — As a separate, non-linked flowchart
Q4
B — The name of the subroutine, such as CalculateTotal
Q5
A — A function call and a procedure call
Section B: Match the Pairs
Q1
A rectangle with extra vertical lines at each side, containing CalculateTotal → A function call. The calculation is drawn as its own separate flowchart.
Q2
A rectangle with extra vertical lines at each side, containing PrintReport → A procedure call. The steps of PrintReport are drawn as a separate flowchart.
Q3
A subroutine symbol stands for a call to a subroutine, so the name of the subroutine is written inside it. → A rectangle with double side lines containing the name ShowMenu
Q4
The steps of a subroutine are not drawn inside the main flowchart. They are drawn as a separate, non-linked flowchart. → Main flowchart: subroutine symbol labelled CheckPassword. Second flowchart: START, CheckPassword steps, END
Q5
A plain process rectangle (no extra side lines) containing a call to CalculateTotal → A plain rectangle is a process symbol, so it does not show a subroutine call. It needs extra vertical lines at each side.
Q6
A subroutine symbol (rectangle with side lines) left empty, with the subroutine's steps drawn inside it as separate boxes → The subroutine's name must be written inside the symbol. Its steps belong in a separate flowchart, not inside the symbol.
Section C: Definitions
Q1
Subroutine symbol — A rectangle with extra vertical lines at each side. It shows a call to a procedure or function that is drawn as a separate flowchart, with the subroutine's name written inside.
Section D: Fill in the Blanks
Q1
CALL ShowMenu()
Q2
Total ← AddTax(Price)
Q3
PROCEDURE ShowMenu() OUTPUT "Menu" ENDPROCEDURE
Q4
FUNCTION Double(N : INTEGER) RETURNS INTEGER RETURN N * 2 ENDFUNCTION
Q5
FUNCTION Double(N : INTEGER) RETURNS INTEGER RETURN N * 2 ENDFUNCTION
Section E: Spot the Error
Q1
C — A call to a subroutine that is drawn as a separate flowchart uses the subroutine symbol (a rectangle with extra vertical lines at each side), not a plain process rectangle. It should be 'Subroutine: CalcTotal'.
Q2
C — The subroutine symbol only holds the name of the subroutine. The calculation belongs inside the separate flowchart for Double. It should be 'Subroutine: Double'.
Q3
B — A procedure does not return a value, so RETURN is wrong here. It should OUTPUT the text. Its call is drawn with the subroutine symbol, with ShowMenu written inside.
Q4
A — The separate flowchart for a subroutine begins with a terminator containing the subroutine's name, here ShowMenu. This matches the name written inside the subroutine symbol where it is called.
Q5
B — A procedure is called with the keyword CALL. It should be 'CALL ShowGrade(Score)'. In a flowchart this call is drawn as a subroutine symbol with ShowGrade inside.