Activity : 2-dimensional Arrays
[1] The questions on this worksheet use this two-dimensional array...

SALES[1..6,1..3]

  January February March
John Sykes £450 £320 £520
Linda Judge £180 £220 £460
Sam Good £620 £650 £710
Lynn Horton £460 £420 £380
Jim Talbot £120 £210 £190
Lucy King £420 £380 £550

 

What is SALES[3,1] ?
Where would you find Jim Talbot's February sales figures?
If n = 2, what is the value of SALES[n+1,n] ?
If SALES[n,n] = £710, what is the value of n ?
What value would this algorithm output?

i = 4
for j = 1 to 3
     if SALES[i,j] < 400 then output(SALES[i,j])
next j

(If all your answers are correct, the green light will show...)

   Back