a methodical, logical rule or procedure that guarantees solving a particular problems.
Pseudocode
a high-level description of the actions of a program or algorithm, using a mixture of English and informal programming language syntax
data type
All values in a programming language have a "type" - such as a Number, Boolean, or String - that dictates how the computer will interpret it.
Integer
All whole numbers (both positive and negative) and zero.
Real/Floating Point
A number with a fractional part such as -13.125
Boolean
A single value of either TRUE or FALSE
Character
A letter,number or symbol represented in a character set table such as ASCII
string
a sequence of characters usually enclosed in quotation marks
Arithmetic Operators
The symbols +, -,, /, %, and* used to denote addition, subtraction (or negation), multiplication, division, percentage, and exponentiation in a formula.
DIV
function used in programming to find the integer result of a division.
MOD
function used in programming to find the remainder of a division.
len(string)
returns the number of characters in a string
string.find(substring)
Returns index of first location if found; returns -1 if not found
ord("a")
Returns the integer value of a character from the ASCII table.
chr(97)
Returns the character represented by the integer from the ASCII table.
Concatenation
A process that joins two strings together using the + operator. Eg "string" + "string" = "stringstring".
Constant
A value that does not change during program execution.
Variable
A value that can change during program execution.
Selection
A generic term for a type of programming construct (usually an if-statement) that uses a Boolean condition to determine, or select, whether or not to run a certain block of code.
Sequence
Two or more programming statements that follow each other in order.
Iteration
A generic term for a type of programming construct (usually a for or while statement) that uses Boolean conditions or counters to determine how many times a code block is repeated.
Assignment
Assigning a value to a variable using the = operator.
Relational Operators
Used to compare two values. Operators include ==,<,>,<=,>=,!=
IF...THEN...ELSE statement
IF (expression1) THEN
(do these statements)
ENDIF
SWITCH-CASE statement
some programming languages support the use of switch/case statements. It is an alternative to nested IF statements.
SWITCH (choice):
CASE1 : print("You have chosen option 1)
(more ststements)
CASE 2: print("You have chosen option 2)
(more ststements)
CASE 3: print("You have chosen option 3)
(more ststements)
ENDSWITCH
Boolean Operators
AND, OR, NOT, XOR
While loop
a programming construct used to repeat a set of commands while a boolean condition is true.
For loop
Loops that have a predetermined start, stop, and increment (step interval).
repeat until loop
A type of loop in some languages that is a post test loop, similar in structure to a do while loop, but terminates when the check condition is true, unlike the do while which terminates when the check is false.
do-while loop
repeatedly executes a block of statements until a specified Boolean expression evaluates to false.
WHILE statement
WHILE(condition):
(statements)
ENDWHILE
FOR statement
FOR (counter(optional start, stop step)):
(statements)
NEXT counter
REPEAT...UNTIL statement
REPEAT
(statements)
UNTIL (condition)
Nested loops
a loop that is contained within another loop
Subroutine
a named block of code which performs a specific task within a program.
Function
A function is a subroutine that always returns 1 value.
Procedure
A procedure is a subroutine that returns 0 or many values.
Function structure
DEF functionname():
(statements)
return value
END FUNCTION
DEF Main():
value = functionname()
END MAIN
Procedure structure
DEF procedurename():
(statements)
END PROCEDURE
DEF Main():
procedurename()
END MAIN
Passing by value
refers to the process of passing a copy of a variable's value to a subroutine.