Write a program that reads a word and prints
the number of syllables in the word. For
this exercise, assume that the syllables are
determined as follows: Each sequence of
adjacent vowels a, e, i, o, u, y, except for the
last e in a word, is a syllable. However, if that
algorithm yields count of 0, change it to 1. For

harry 2 syllables

hairy 2 syllables

hare 1 syllable

the 1 syllable

2 Years
Discussion Span
Last Post by iamthwee

That's a nice assignment, Farhanalee, but we are most interested into finding out what part of that assignment it is you are having trouble with.

You will find that you get a lot more response if you show us what you have already tried and where you are stuck.

In the end: no, we won't do your homework for you.
as the community rules say:

Do provide evidence of having done some work yourself if posting questions from school or work assignments


There's a few things I would try first.

  1. Would be to loop through each character
  2. Would be to identify if the character is a vowel
  3. Would be to identify if the vowels appear one after the other (adjacent)
  4. Check if last vowel is an 'e'
  5. If no vowels are found return '1'

Well - that was me being optimistic and assuming you're going to try and attempt the assignment. Chances are you won't.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.