Arrays
Errors
Loops
Control
100
A data structure that can hold a given number of elements of the same type
What is an array?
100
OUTPUT badValue

INPUT badValue

What is an uninitialised variable?
100
Always loops for the same number of iterations
What is a FOR loop?
100
Used to allow portions of an algorithm to be executed under specific conditions.
What are control structures?
200
The number of elements that can be stored in an array
What does array length refer to?
200
FOR count = 0 to 5

     INPUT result

     IF result < 100 THEN

         count = 5

      ELSE

          OUTPUT "Nice one!"

ENDFOR

What is incorrect loop structure? (or abuse of for loop index)
200
Loops zero or more times
What is a WHILE loop?
200
The condition used to make a selection
What are boolean expressions used for in control structures?
300
int[] numbers = new int[10];
What is an array of 10 integers in Java?
300
FOR count = 10 to 1

     OUTPUT count

ENDFOR

OUTPUT count + ", liftoff!"

What is loop index used out of scope?
300
Always loops at least once
What is a DO-WHILE Loop?
300
The value used to establish precision for comparing real numbers
What is tolerance/delta?
400
names[6] = "Caprica"
What is the syntax for initialising the 7th element of a String array to "Caprica"?
400
starks = 10

lannisters = 100

WHILE (lannisters > starks)

     starks = starks - 1

ENDWHILE

What is an infinite loop?
400
((stopVal - startVal) / incVal) + 1
What is the number of times a FOR loop will iterate?
400
The boolean expression used to check if two strings are the same in Java
What is String.equals()?
500
int[][] jumpCoords;
What is a the syntax for declaring a 2d array of ints called jumpCoords in Java?
500

sum = 0

INPUT num

WHILE num > 0 DO

    sum = sum + num

    INPUT num

ENDWHILE

OUTPUT 1.0 / (convert to real)sum


What is a divide by zero error?
500
f = 1; for (i = 2; i < n; i++) { f = f * i; }
What is n! (n factorial)?
500
The boolean expression used to check if (2.5) and (5.0/2.0) are equal
What is ABS(2.5 - 5.0/2.0) < TOLERANCE?