Alogorithm Specification and Design notations. Flashcards
What is an algorithm
An alogorthim is a sequence if steps taken to solve a problem
It is not a program. Instead it is a a description of a program that needs to be coded
What does an alogorthim contain
Contains two elements.
The actions that need to be taken to solve the problem. Such as computational steps
The order in which these are meant to be carried out
Name programming languages
Live code
C++
Java script
What is the algorithm I must Know
Input validation
What is Input validation
It is an algorithms that validates if the data being entered is valid and correct. If not the user will be given the option to re-enter their data.
Learn the input validation algorithm in
Pseudocode
And livecode
Name two of the most common ways of deigning a program
Pseudocode - text based design which shows the main steps of the program in English like statements
Flow charts - shows main steps of the program in a graphical form
What specific type of pseudocode do I need to know
Haggis
Spell the text based design that explains the main steps of the program in English like statements
Pseudocode
“Pseudocode is considered a “first draft” of the actual program.
It is an artificial and informal tool, written in programmer’s language, helps to make algorithms.
concentrates on logic of program - not syntax errors - should be a description of an algorithm in detail to allow implementation be easy
The design is built up of two parts, the first is the Stepwise Design. This shows the main steps of the program.
The second part is the Stepwise Refinement. This involves breaking these main steps into even smaller steps so eventually, one line of pseudocode becomes one line of program code.
The design language is called HAGGIS and is a requirement of the SQA.
What does the command RECIEVE do.
The command RECEIVE is used get input. Similar to ASK used in LiveCode.
What does the command SEND do?
The command SEND is used for output. Similar to PUT used in LiveCode.”
Put in livecode is what in Pseudocode
Send
Pseudocode rules
Simple English like statements Each instruction on a separate line Keywords in capitals eg. IF, THEN, SET, RECIEVE SEND, END etc. Indentation to show structure Top to bottom
What does the oval in flow charts represent
The start and end of program