2.1.3 - Thinking Procedurally Flashcards

Component 2

1
Q

What does this shape represent in a flowchart?

A

A Process - An example would be “Extract the first three letters of the surname”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does this shape represent in a flowchart?

A

Input / Output - An example would be ‘Please enter the surname’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does this shape represent in a flowchart?

A

This is called a terminator it is used to signal the start and end of the flowchart. All flows must reach the terminator.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does this shape represent in a flowchart?

A

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?’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is this type of diagram referred to as?

A

Decomposition Diagram

or

Structure Chart

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a sub-procedure?

A

These are named blocks of code and normally take the form of either a procedure or a function.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What sub-procedures might exist for a game of Monopoly?

A

BuyProperty()
PassGo()
RollDice()
MovePiece()
PayRent()
PickChanceCard()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the benefits of sub-routines?

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly