Professional Documents
Culture Documents
Computer Science - 1D Arrays HW
Computer Science - 1D Arrays HW
length -1
If I > 70 then
Output(I)
End if
End loop
2. Sum = 0
Loop I from 0 to NUMBERS.length -1
sum = sum + NUMBERS[I]
End loop
Avg = sum / NUMBERS.length
output(Avg)
3. Output MARKS[0]
4. Output NUMBERS[2]
5. Output ARGUMENTS[-1]
6. Output ARGUMENTS[arguments.length -1]
7. MARKS[MARKS.length -2] = 90.5
8. Loop I from 0 to ANIMALS -1
Extension
1. ARRAY = TESTS
sum = 0
end loop
ABOVE = 0
BELOW = 0
ABOVE = ABOVE + 1
end if
BELOW = BELOW + 1
end if
end loop
Output avg
Output ABOVE
Output BELOW
2. Array = [1,2,3,4,5]
Counter = 4
loop I from 0 to 4
Output Array[Counter]
Counter = Counter -1
End loop