Data Types
Arithmetic Operators
Other
Constructs
The else bit is optional – you don’t have to have it The condition is any expression that evaluates to a Boolean Notice how the statements are indented (well, hopefully they’ll display indented when I publish this…) When using WHILE and REPEAT loops, to count, you need to manually initialize and increment the counting variable The statements inside a loop should cause a change in one of the values in the condition, otherwise you may create an infinite loop |
Procedure & Functions
Procedures and functions don’t have to take parameters, but the parentheses () are necessary Functions must have a return type and must return something (of that type) File Handling For
With a FOR loop, incrementing and initializing of the counting variable are done automatically You can call the counting variable (i, in this case) anything you want, and you can also set the = something TO something values to whatever you want it to count from and to Relational / Comparison Operators
Logical / Boolean Operators CASE
In a case statement (that’s switch statement to Java/C# people) you can have however many options you want, but there must always be a default for if none of the options match In the example above, something is the variable that is being checked, and this, that and other are things it’s being compared with |
String Manipulation
File Handling
“filename is at end of file” can be used in the condition of loops, to iterate through all the records High-Level QuestionsOccasionally, you’ll be asked to write something in a real language I think the course does require you to be taught the basics of a high-level procedural programming language in the first year Again, though, the questions are more about understanding what to do than following the correct syntax Familiarise yourself with how to write the constructs above in a high-level language (i.e. not assembly…) |
Cheatography
https://cheatography.com
PseudoCode Cheat Sheet (DRAFT) by mason
Pseudo code
This is a draft cheat sheet. It is a work in progress and is not finished yet.