Ad
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Thank you for taking my feedback very positively @Rochieoreo :-)

  • Default User Avatar

    Thank you, ill use that in further development. :)

  • Custom User Avatar

    I must admit, I should have used lambda for this question. I was doing a brute force first and I just submitted the answer too quick. But I see a lot of answers here that I think are great and much better than my answer!

  • Custom User Avatar

    Check @superklamer solutin, There is no need for "break" on each case! It all can be nest like the switch statement above. However, read my comment, I do like that approach
    switch(strArray[incriment])
    {
    case 'e':
    case 'a':
    case 'i':
    case 'o':
    case 'u':
    vowelCount++;
    break;
    default:
    break;
    }

  • Custom User Avatar

    I must admit that that this is one of the ways I wanted to solve this problem. If we put efficiency aside, this a cleaner and ready to read approach in bigger system. I know the the Vowels are not changing, but for things that are going to chance in the future and you want to maintain clean and readable code. I'd do it that way

  • Custom User Avatar

    Unless I am missing something, the problem with this approach that it is assuming that the string is coming in in all lower case. Upper, or mix case will fail.

  • Custom User Avatar