Data Types & Structures
Rules: INT and REAL are typed as numbers only STR must be in double quotation marks i.e. "Hello" CHAR must be in single quotation marks i.e. 'H' BOOL must be in either TRUE or FALSE Array can be assigned to variables and must be inside braces. i.e. names = ["Andy", "Cindy", "Bobby"] Operators (Arithmetic)
Note: MOD will give you the remainder of the number Operators (Assignment)
The >= operator means greater than or equal to The <= operator means lesser than or equal to Operators (boolean)
Boolean Operators are also called Logical Operators. AND means conjunction, OR means disjunction, NOT means negation |
The FOR Loop
Running this on raptor/ other engines will output: 1 2 3 REPEAT Loop
Running this on raptor/ other engines will output: 1 2 3 WHILE Loop
If you put this in raptor/other engines they will output: 1 2 3 Writing An Algorithm Example
Fibonacci Sequence is a sequence where each number is the sum of the two preceding ones. For example: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34 |
Conditional Statements (IF)
Description: Conditional Statements are IF statements. The IF statement check if a condition is TRUE or FALSE. In the English language, we say: If you come to the party, I'll buy one pizza. In the computer language. We say it like this: IF answer = “YES” THEN pizza = 1 ENDIF As simple as that! Extended IF statement
IF and ELIF (else if) are used for a choice between several different values. You can either use ELIF or CASE, it is up to you. CASE OF
CASE is another conditional statement that is use for several different values Functions
Running this on a engine/idle: count_pizza_slices(5) Output: 40 |
Cheatography
https://cheatography.com
Algorithm IGCSE Cheat Sheet by [deleted]
This is a cheat sheet for pseudocode in Computer Science IGCSE ~
Created By
Metadata
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets