2.1.3 Thinking Procedurally
No description yet. This curated deck is ready for daily study.
Card preview (8)
What does this shape represent in a flowchart?
A Process - An example would be “Extract the first three letters of the surname”
What does this shape represent in a flowchart?
Input / Output - An example would be ‘Please enter the surname’
What does this shape represent in a flowchart?
This is called a terminator it is used to signal the start and end of the flowchart. All flows must reach the terminator.
What does this shape represent in a flowchart?
A decision - Think of this as an IF statement. The shape should have two arrows coming out of it (true/false) An example would be ‘Is the total <= 7?’
What is this type of diagram referred to as?
Decomposition Diagram or Structure Chart
What is a sub-routine?
These are named blocks of code and normally take the form of either a procedure or a function.
What sub-routines might exist for a game of Noughts and Crosses?
PlacePiece() CheckDiagonal() CheckHorizontal() CheckVertical() Restart() SwapPlayer()
What are the benefits of sub-routines?
Breaking code down into functions / procedures / scripts • Write once and call repeated times - Avoids repeated code • Small sub-programs are easier to read/understand/modify • Can be tested individually and then added to the main program. • Can be reused in other programs • Can give sub-routines to different programmers to build concurrently