Computer science help pleaseeee?

Computer science help pleaseeee?




For the following questions assume that we have an 11 element array NUM containing the following values:



0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10

__|___|__|___|___|___|___|___|___|___|_...

6 | 1 | 3 | 2 | 7 | 6 | 5 | 9 | 0 | 8 | 4



What would be the contents of the array after the following algorithms are executed?



A) for i = 1 to 9

Num( i ) = NUM( i ) + NUM( i + 1 )

next i





B) for i = 2 to 9

Num( i ) = NUM( i ) + NUM( i +1 ) + NUM(i - 1)

next i





C) for i = 1 to 10

Num( i ) = NUM( i ) + 2*i

next i





D) for i= 1 to 10

Num( i ) = NUM( i ) + Num(11 - i)

next i





thank youuu


Update 1: the row beginning with 6 is all of the values





No Answers Posted Yet.