Learning Outcomes
• explain in simple terms the underlying concepts of computational thinking – abstraction and decomposition;
• design solutions using algorithms, flow diagrams and pseudo-code;
• create and evaluate algorithms, including those for basic sorting and searching;
• refine a solution to a problem during design;
• identify data requirements for a solution and develop an appropriate user interface;
• use a dry run to test a solution;
Computational thinking allows us to take a complex problem, understand what the problem is and develop possible solutions. We can then present these solutions in a way that a computer, a human, or both, can understand.
At the very least Computational thinking requires skills in the following four important processes.
• Problem Decomposition
• Pattern Recognition
• Abstraction
• Algorithm Design
Abstraction is the process of filtering out – ignoring – the characteristics of patterns or information that we don’t need in order to concentrate on those that we do in order to solve a problem. It is also the filtering out of specific details. From this we create a representation (idea) of what we are trying to solve.
Problem decomposition involves breaking a large, complex problem into a number of smaller, simpler ones.
• The smaller problems should be easier to solve than the large one.
• It should be possible to combine the solutions to the smaller problems, to create a solution to the larger problem.
This involves looking through data to identify patterns and trends. These patterns and trends can then be used to allow us to reuse and adapt solutions from old problems in new solutions.
An algorithm is a sequence of steps designed to solve a particular problem. An algorithm might be expressed:
• in a stylised form of English called pseudocode;
• In a graphical form called a flow diagram;
• directly in a programming language such as Python, Java or C#.
Pseudocode is a simplified version of a programmiung language, it removes the syntax and makes use of simple english words such as repeat, if, print, input, output. It allows us to quickily design solutions to problems without worrying too much about syntax errors. It is useful as it will involve us identifying the variables necessary to solve a problem and save us time in the creation of the actual program.
A flow chart is a visual representation of an algorithm which shows the main processes involved in solving a problem and how they are related. The main symbols used are shown on the image to the left. Flowcharts can be easier to understand and create than pseudcode.
When designing a solution to a problem we can use one method or both depending on our own personal preference.
Create a flow chart for the following activities:
1- Create a flow chart explaining how to make a cup of tea, it should contain at least one decision.
2- Create a flow chart which works out the area of a rooms. The program should output:
Large room if the area is greater than 100m2.
Medium room if the area is greater than 50m2.
Small room if the area is less than 25m2.
3- Create a flow chart for a login system for a social network. This should involve the use of a username and password. The account should be locked after 3 wrong attempts.
4- Convert your solutions into pseudocode.
A dry run is a paper-based exercise and the programmer goes through the solution step by step. This is used to ensure the programs works as expected before the program is tested by users.
Keywords