2.1.3 - Thinking Procedurally Flashcards
Component 2
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-procedure?
These are named blocks of code and normally take the form of either a procedure or a function.
What sub-procedures might exist for a game of Monopoly?
BuyProperty()
PassGo()
RollDice()
MovePiece()
PayRent()
PickChanceCard()
What are the benefits of sub-routines?
- 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 procedures to different programmers to build concurrently