Computational Thinking (I) - Algorithms Flashcards
What is computational thinking?
The steps you take to find the best solution to a complex problem
Before a problem can be tackled, the problem itself - and the ways in which it could be solved - needs to be understood
What are the three key techniques of computational thinking?
Decomposition
Abstraction
Algorithmic Thinking
Give an example of computational thinking when planning a visit to the cinema
What does the following show?
Pseudocode
What are algorithms?
Sets of instructions
In real life – recipes / directions / game rues
In computer science – often written as pseudocode
What is pseudocode?
Pseudocode should show an algorithm’s steps without worrying about the finer details (e.g. syntax)
It should be quick to write and then easily converted to a programming language
What is pseudocode not?
A programming language
What should pseudocode be like for it to be useful?
Readable
Easy to interpret
Not too vague
Write an algorithm in pseudocode to calculate the salary of a worker after a 10% pay rise
input salary
newsalary = salary x 1.1
output newsalary
Write an algorithm in pseudocode to check is a password is 6 characters long and different from the username of a user logging into a website. If invalid, it should say why
What is a flowchart?
A flowchart is a diagram that represents a set of instructions
What do flowcharts normally contain?
Flowcharts normally use standard symbols to represent the different types of instructions
What are the symbols of a flowchart used for?
Symbols are used to construct the flowchart and show the step-by-step solution to the problem
Name, draw the image and give the usage for common flowchart symbols
Draw a flow diagram to ask what the best subject is (trying again if it isn’t computer science)
What can flowcharts be used for?
Planning out programs
What can flowcharts show?
Sequences, Selections and Iterations
What is a sequence?
Sequence – only one way from the start to the end
What is a selection?
Selection – multiple ways from start to stop