Try it on paper first. A hint, the key idea and the worked solution are here when you need them.
Count the vowels in the word education.
A loop and an if together can count things.
Have you tried it?
Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, compare your working with the solution.
Plan. Start count = 0. Go through the letters. For each letter, ask if it is in "aeiou" (Chapter 8). If yes, add 1.
The vowels are e, u, a, i and o, so the answer is 5.
Check. education has nine letters. The four consonants are d, c, t and n. . ✓
Log in to join the discussion.
Loading…