Question: What missing code should be added to this class to ensure that calling count _ even ( { 1 , 2 , 3 , 4

What missing code should be added to this class to ensure that calling count_even({1,2,3,4,5}) returns 2?
class TEST
feature
count_even(arr: ARRAY[INTEGER]): INTEGER
local
count: INTEGER
i: INTEGER
do
count :=0
from
i :=1
until
i > arr.count
loop
if ____ then
count := count +1
end
i := i +1
end
Result := count
end
end
Question 6Answer
a.
arr.item(i)\\2<=0
b.
arr.item(i)\\2>=0
c.
arr.item(i)\\2!=0
d.
arr.item(i)\\2=0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!