Helpsheet - Can You Compute?

advertisement
Writing Algorithms
When writing Algorithms you can either write them using a Flowchart or Pseudo Code
When using a flowchart these are the standard symbols:
Shows Data Flow
Process
Input/Output
Decision
Examples of Sequence, Selection and Loops in Flowcharts
Standard Key Words to use in Pseudo Code
Technique
Selection/Conditional Statement
Example
IF condition THEN
true alternative
ELSE
false alternative
ENDIF
FOR i to/in …
statements to carry out
END FOR
Iteration/Loops
WHILE condition THEN
statements to carry out
END WHILE
Operators
REPEAT statement UNTILL …
> Greater Than
< Less Than
>= Greater than or equal to
<= Less than or equal to
== Equal To
= Equals
!= not equal to
INPUT….
Input and Output
OUTPUT…
PROCEDURE name
Function/Procedure
END PROCEDURE
FUNTION name
END FUNTION
Download