Question: What missing code should be added to this class to ensure that calling count _ consonants ( Hello World ) returns 7 ? class

What missing code should be added to this class to ensure that calling count_consonants("Hello World") returns 7?
class TEST
feature
count_consonants(s: STRING): INTEGER
local
count: INTEGER
i: INTEGER
vowels: STRING
do
count :=0
vowels := "aeiouAEIOU"
from
i :=1
until
i > s.count
loop
if ____ then
count := count +1
end
i := i +1
end
Result := count
end
end
Question 10Answer
a.
vowels.has(s[i])
b.
not vowels.has(s.item(i))
c.
vowels.has(s.item(i))
d.
s.item(i) not in vowels

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!