Apuntes
Topic 4: Computational thinking

Contenido del apunte (4)
Página 1
4.1.1:Procedural Thinking
An algorithms is a set of instructions to be followed in a clear manner.
Procedural thinking
Eg. A procedural algorithm for making a cup of tea:
1. Put water in kettle
2. Turn on kettle
3. Get a cup
4. Place tea bag in cup
5. Pour water in cup
6. Wait
7. Remove tea bag
8. Stir
Each step could be broken down further for a computer as opposed to a human because computer's cannot make assumptions.
Eg. For step 1:
1. find the kettle
2. take the kettle to the tap
3. turn on tap
4. wait until kettle is full
5. Turn off tap
6. Take kettle to base
Página 2
4.1.2:
Algorithms require an order and number based system to it.
Each step is a sub-procedures the break down our problem.
Top down programming: Looking at the big problem, breaking it down into little problems and then solves them one at a time. This is the way that we should work in our algorithms unit. There is also Bottom up programming: Solving little problems without looking at the bigger picture.
Página 3
4.2.6: Two ways of representing algorithms
1. Pseudocode (4.2.5-6)
Uses conventional construction of computer code with less emphasis on syntax
Describes logical flow of a program
A program flow might "branch" (If statement in Java) or a "loop" (for or while loop in Java) or "Jump to" ("go back to step 4) 2. Flow Diagrams (4.2.4)
Decision tree that shows logical flow of a program using standardized diagram notation.
The notation for flow diagrams is pictured below:

While loop- runs until a condition tests true of false
for loop- runs a set number of times
Página 4
PSEUDOCODE
Keywords:
input
output
if then else
loop
mod
div
AND
OR NOT
Variables: In uppercase
NAME
Comment: //
Methods: Mix case names (getRecord)
dot notation to invoke
Información
- Descripción
- International Baccalaureate Computer Science Apunte sobre Topic 4: Computational thinking , creado por Judy Asman el 17/08/2016.
- Creado por
- Judy Asman
- Visitas
- 9
- Etiquetas
- Valoración