Pseudocode
- Pseudocode is a form of high-level programming language that is used to represent the logic of an algorithm or program without being tied to any specific programming language.
- It is used as a tool for planning and designing software, as it allows developers to express their ideas in a clear and concise way before writing actual code.
- The conventions for writing pseudocode for this course are as follows:
- Use simple, declarative sentences
- Avoid using programming-specific syntax or constructs
- Each instruction should be on its own line
- Use indentation to indicate the structure of the program
- The names of any functions or methods should be underlined. (subprocess)
- Keywords should be in uppercase.
Note
Rarely will you encounter pseudocode in a real-world software development environment, as most developers prefer to write code directly in a specific programming language. However, it can still be useful for planning and communicating ideas with other developers or stakeholders. It is also beneficial while learning to code as it helps to understand the logic behind the program before writing actual code.
-
The keywords in pseudocode typically come in pairs
-
The keywords are:
- BEGIN / END
- IF / THEN / ELSE / ENDIF
- WHILE / DO / ENDWHILE
- FOR / TO / ENDFOR
- CASEWHERE / OTHERWISE / ENDCASE
- REPEAT / UNTIL
- INPUT / OUTPUT
- GET
- DISPLAY