% 4a
var four : array 1 .. 3, 1 .. 5 of int
% 4b
for row : 1 .. 3
for col : 1 .. 5
four(row, col) := 0
end for
end for
% 4c
var grandTotal : int := 0
for row : 1 .. 3
for col : 1 .. 5
grandTotal := grandTotal + four(row, col)
end for
end for
% 4d
var row2sum : int := 0
for col : 1 .. 5
row2sum := row2sum + four(2, col)
end for
% 4e
var col3sum : int := 0
for row : 1 .. 3
col3sum := col3sum + four(row, 3)
end for
% 4f
var negSum : int := 0
for row : 1 .. 3
for col : 1 .. 5
if four(row, col) < 0 then
negSum := negSum + four(row, col)
end if
end for
end for
% 4g
for row : 1 .. 3
for col : 1 .. 5
four(row, col) := four(row, col) ** 2
end for
end for
% 4h
var largest : int := four(1, 1)
for row : 1 .. 3
for col : 1 .. 5
if four(row, col) > largest then
largest := four(row, col)
end if
end for
end for