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
example:

harry 2 syllables

hairy 2 syllables

hare 1 syllable

the 1 syllable

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

Member Avatar for iamthwee

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.