Pseudo Code Rules: Variable Names
Pseudo Code Rules: Variable Names
Variable names
1. lower case - totalsum
2. camel casing totalSum
3. Underscore - total_sum
4. No special characters exception is underscore _
5. Use descriptive variable names - count = 0 is acceptable , c = 0 is not acceptable (use names
that will help to self-document the program)
6. COUNT is not the same as count or the same as Count ( *** CASE MATTERS !!!!!! )
MODULES
1. Use all upper case letters for module names
( examples : HOUSEKEEPING, MAINLOOP, FINISH)
2. Modules should be distinguishable from other modules by UPPER CASE perhaps underlining, bolding
or INDENTING moving in several spaces to type the body of the module.
HOUSEKEEPING
count=0
heading = Class Report
READ name, class
RETURN
3. Modules should begin with the module name and end with a return statement.
KEY WORDS
1. Keywords should ALWAYS be upper case.
IF, ELSE, ENDIF, for our selection/decisions
READ, GET, INPUT for input and WRITE, PRINT, DISPLAY, for output
Can use DO or PERFORM to call a module
SET can be used to assign ( SET count = 0 )
2. Keywords are : DOWHILE, ENDWHILE, WHILE, DO UNTIL for our loops
LOOPS
1. Loops should always be indented when writing pseudocode.
2. Selection/Decisions should be indented, this means IF and ENDIF statements should line up
FLOWCHARTING and PSEUDOCODE
1. Always use assignment statements, for example : count = count + 1.
Add 1 to count is not acceptable.
2. Use correct symbols for flowcharts.