What is a constant?
Named variable fixed for the duration of the program
Written at the same time the program is written
What is an assignment?
Storing a value to a variable or constant
What is a character?
A single letter, number, symbol or control code
What are all the arithmetic operators?
*
/
MOD or %
DIV or //
What is sequence?
Instructions executed 1 after another in order
What is selection?
Branches based on a condition
What is nesting?
À loop or selection inside another loop or selection
What is the pseudo code for totalling?
total = 0
count = 0
for i = 0 to 9
num = input( “enter a number” )
total = total + num
count = count + 1
next i
print ( “total: “ + str(total))
print ( “count: “ + str(count))
What is the pseudo code for averaging?
average = total / num
print (“average: “ + str(average))
What is the pseudo code for finding the max or min?
max = 0
min = 999
num = input (“enter a number”)
if num > max then
max = num
endif
if num < min then
min = num
endif
What is the pseudo code for counting
count = 0
for i = 0 to 9
count = count + 1
next i
print (“total items: “ + str(count))
Write a function in pseudo code
FUNCTION addNumbers (num1, num2)
sum = num1 + num2
RETURN sum
ENDFUNCTION
What is pseudo code for?
À method of writing up a set of instructions for a program in plain English without worrying about syntax rules
Used for planning a program in plain
How to spot an off by one mistake?
In a country controlled loop make sure to remember the 2nd number is excluded
How to spot wrong operators?
= vs ==
< vs <= and > vs >=
/ vs //
and vs or
How to spot infinite loops?
Make sure there’s a condition that tells it to stop when conditions are full filled
What is a trace table?
Trace the value of each variable as each line of code is being executed
What is a parameter?
A named variable that acts a placeholder for the data the function needs to perform a task