0% found this document useful (0 votes)
14 views

Pseudo Code Rules: Variable Names

The document provides guidelines for writing pseudocode including: 1. Variable names should be in lower case, camel casing, or use underscores. Descriptive names are preferred. Case matters. 2. Modules should be in uppercase and distinguishable from other code. They begin with the name and end with a return statement. 3. Keywords like IF, ELSE, and loops should be in uppercase. Keywords call modules or assign values. 4. Loops and decisions should be indented. IF and ENDIF statements should line up. Pseudocode uses assignment statements and standard flowchart symbols. Modules and standard structures should be used.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Pseudo Code Rules: Variable Names

The document provides guidelines for writing pseudocode including: 1. Variable names should be in lower case, camel casing, or use underscores. Descriptive names are preferred. Case matters. 2. Modules should be in uppercase and distinguishable from other code. They begin with the name and end with a return statement. 3. Keywords like IF, ELSE, and loops should be in uppercase. Keywords call modules or assign values. 4. Loops and decisions should be indented. IF and ENDIF statements should line up. Pseudocode uses assignment statements and standard flowchart symbols. Modules and standard structures should be used.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

PSEUDO CODE RULES

for Programming Concepts

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.

3. Use arrows and YES / NO or TRUE / FALSE indicators on flowcharts.


4. Always use module construction for code and flowchart.
5. Always use one of the three structures flowcharts/pseudo.
6. Pay attention to the selection structure for IF statements. The structure looks like a BOX.

You might also like