Answer
(a) $m-1$, $sum+a[i+1]$
(b) $m+1$, $sum+a[j-1]$
Work Step by Step
(a) We need the following to filling the blanks:
for i:=0 to $m-1$
sum:= $sum+a[i+1]$
(b) We need the following to filling the blanks:
for j:= 2 to $m+1$
sum:= $sum+a[j-1]$