Computer Science LearnITWithMrC ⛯ Year 7 Year 8 Year 9 GCSE
ICT
Responsive image

LO 2 - Developing algorithms

Flowchart Symbols

A flowchart is a diagram that represents a set of instructions. Flowcharts normally use standard symbols to represent the different types of instructions. These symbols are used to construct the flowchart and show the step-by-step solution to the problem.

Flowchart Symbols

A flowchart is a diagram that represents a set of instructions. Flowcharts normally use standard symbols to represent the different types of instructions. These symbols are used to construct the flowchart and show the step-by-step solution to the problem.

Algorithm

Topic B - Standard methods and techniques used to develop algorithms

Designing an algorithm

When designing an algorithm, consider if there is more than one way of solving the problem.

When designing an algorithm there are two main areas to look at:

  • the big picture - What is the final goal?
  • the individual stages - What hurdles need to be overcome on the way to the goal?
  • Understanding the problem

    Before an algorithm can be designed, it is important to check that the problem is completely understood. There are a number of basic things to know in order to really understand the problem:

  • What are the inputs into the problem?
  • What will be the outputs of the problem?
  • In what order do instructions need to be carried out?
  • What decisions need to be made in the problem?
  • Are any areas of the problem repeated?
  • Once these basic things are understood, it is time to design the algorithm.


    Pseudocode

    Most programs are developed using programming languages. These languages have specific syntax that must be used so that the program will run properly. Pseudocode is not a programming language, it is a simple way of describing a set of instructions that does not have to use specific syntax. Common pseudocode notation

    There is no strict set of standard notations for pseudocode, but some of the most widely recognised are:

  • INPUT - indicates a user will be inputting something
  • OUTPUT - indicates that an output will appear on the screen
  • WHILE - a loop (iteration that has a condition at the beginning)
  • FOR - a counting loop (iteration)
  • REPEAT - UNTIL - a loop (iteration) that has a condition at the end
  • IF - THEN - ELSE - a decision (selection) in which a choice is made
  • --> any instructions that occur inside a selection or iteration are usually indented

  • Using pseudocode

    Pseudocode can be used to plan out programs.

    Flowcharts and Pseudocode

    Input / Output

    Flowchart

    Selection

    Flowchart

    Iteration

    Flowchart

    Task

    Write out an algorithm in pseudo-code to ask a user to input three numbers and ouput the numbers in order of largest to smallest.

    You have 10 minutes


    Task

    Write out a flowchart for a program that plays rock, paper, scissors:

    You have 15 minutes



    • Learning Objectives

    • I can interpret pseudocode and apply processes to calculate outcomes.
    • I can interpret pseudocode and evaluate the structure and logic of given code against given requirements.

    Flowchart Symbols

    A flowchart is a diagram that represents a set of instructions. Flowcharts normally use standard symbols to represent the different types of instructions. These symbols are used to construct the flowchart and show the step-by-step solution to the problem.