# 02 - Computational Thinking

1. An _________________ is a plan, a set of step-by-step instructions to resolve a problem. In an _____________, each instruction is identified and the order in which they should be carried out is planned.

alacrity

argument

algorithm

function

2. There are two main ways that algorithms can be represented. As P___________ and F_____________

Pontification and Florification

Pseudocode and Flowcharts

Pseudofunctions and Flowgraphs

Pointers and Flows

3. Each step of the algorithm is written on a line of its own in sequence. In the pseudocode example below instructions are written in ______________, _____________ in lowercase and messages in sentence case.
```OUTPUT 'What is your name?'
INPUT user inputs their name
STORE the user's input in the name variable
OUTPUT 'Hello' + name
OUTPUT 'How old are you?'
INPUT user inputs their age
STORE the user's input in the age variable
IF age >= 70 THEN
OUTPUT 'You are aged to perfection!'
ELSE
OUTPUT 'You are a spring chicken!'```

uppercase / constants

uppercase / variables

lowercase / constants

uppercase / functions

4. Before computers can solve a problem, the problem and the ways in which it can be resolved must be understood. DECOMPOSITION helps by ...

breaking down complex problems into more manageable parts.

analysing the problem and making it more complex

designing the problem before actually coding a solution

taking the problem and putting it together with other problems first to compare

5. Why is decomposition important?
```#1 Breaking the problem down into smaller parts means that each smaller problem
can be examined in more detail.

#2Dealing with many different stages all at once is much more difficult
than breaking a problem down into a number of smaller problems and solving
each one, one at a time.

#3If a problem is not decomposed, it is much harder to solve.```

Statements #1 and #2 are correct

Only statement #3 is correct

All three statements are correct

Decomposition isn't important. It is utterly pointless.

6. ______ recognition is one of the cornerstones of Computer Science. It involves finding the similarities or _______ among small, decomposed problems that can help us solve more complex problems more efficiently.

Pattern / patterns

Pseudocode / functions

Pattern / syntax errors

Parameters / patterns

7. What is the following a definition of?: "It involves filtering out, or essentially, ignoring, the characteristics that we don't need in order to concentrate on those that we do. i.e ignoring the irrelevant details of any given problem"

This is called Decomposition

This is called mild computerised obfuscation

This is called Algorithmic expression

This is called Abstraction

8. How is abstraction used in the creation of a chess computer game? Assume that the board is created as an arrays and players are objects that have positions on the board.

Abstraction would require you to break the problem down

Abstraction would require the programmer to consider the shape and size of pieces

Abstraction could mean that the shape and style of the pieces may not be required.

Abstraction could mean that every single detail would need to be considered

9. How would abstraction be used to represent a map on a computer? Which one of the two options below best demonstrates abstraction in this case?
```#1 Option 1
Towns/places would be represented with their name, maybe a circle or shape.
Road names may be on the lines.
Fields, hedges, houses etc. would not necessarily be in the model.

# Option 2
Towns/places would be represented in great detail with expert artwork
Roads would be measured and drawn to scale
Road names, and depictions of potholes would also be shown on the lines
Fields, hedges, houses and even stones (where possible) would be included```

Option #2

Option #1

Neither option

Both options are equally valid demonstrations of the use of abstraction

10. The following diagram shows breaking up the problem of creating a battleship game into smaller modules. This is an example of:

computational functional thinking

decartation

abstractional thought

decomposition