Identify sub-procedures necessary to solve a problem.
2.1.3 Thinking Procedurally
Thinking Procedurally — Note 4 of 4
Candidates need to understand the use and purpose of sub-procedures in a program and identify where they may be used. Candidates should be able to write pseudocode, code and/or flowcharts for sub-procedures, using parameters where appropriate, and interpret or complete structure diagrams.
Sub-procedures (subroutines) are named blocks of code that carry out a specific task. Identifying where they are needed makes programs modular, easier to test and easier to maintain.
Exam tipCommon mistake
A named, self-contained block of code that performs a specific task and can be called from elsewhere in the program.
procedure runQuiz()
score = 0
for q = 1 to 10
question = getQuestion(q)
answer = askUser(question)
if checkAnswer(q, answer) then
score = score + 1
endif
next q
showResult(score)
endprocedure