Question: What missing code should be added to this class to ensure that calling sum _ of _ even ( { 1 , 2 , 3
What missing code should be added to this class to ensure that calling sumofeven returns
class TEST
feature
sumofevenarr: ARRAYINTEGER: INTEGER
local
sum: INTEGER
i: INTEGER
do
sum :
from
i :
until
i arr.count
loop
if then
sum : sum arr.itemi
end
i : i
end
Result : sum
end
end
Question Answer
a
arr.itemi
b
arr.itemi mod
c
arr.itemi
d
arr.itemi mod
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
