National 5 – Design Notations (Revision)

N4

  • graphical to illustrate selection and iteration
  • other contemporary design notations

N5

  • pseudocode to exemplify programming constructs other contemporary design notations

 

Flow Chart
Flow Chart

You read a flow chart from the START block and follow the arrows (normally downward). In the example above you can see selection taking place in the first diamond, while the second diamond allows for iteration (repetition) to take place.

Structure Diagram
Structure Diagram

A structure diagram shows how the program is structured and in some cases how data can be passed from one part to the other.

Pseudocode

Pseudocode is an informal text description of the working of a program it is written using English words but not in a sentence structure. There are no syntax rules due to its informal nature, sometime they are numbered and sometimes they are not.

The SQA can sometimes refer to pseudocode in the exam when describing a program. However, they are often referring to Standard Reference Language. Rule of thumb, if they are asking you to read pseudocode it will be SRL, if they are asking you to write psuedocode then they mean psuedocode. Hopefully they will start using the correct terms in future papers.

Example 1

  1. set total = 0
  2. set count =0
  3. while count less than 10
  4.     get nextInput from user
  5.     add nextInput to total
  6.     add one to count
  7. end while
  8. display total/10

Example 2

get age from user
while age < 0 or age >130
    display error
    get age from user

display age

Leave a Reply

Your email address will not be published. Required fields are marked *