X1665: vowelsToUpper

Description

Given a string, compute recursively a new string where all vowels in the original string will now be in upper case in the new string. So given "hello", return "hEllO".

We have defined a method for you named boolean isVowel(char ch) that returns true if the argument passed is a vowel (i.e. a, e, i, o, u).

Constraints

  • You cannot use the following methods from the String class: indexOf, lastIndexOf, contains, endsWith, startsWith, matches, replace, nor replaceAll.

Documentation

Examples:

vowelsToUpper("hello") -> "hEllO"
vowelsToUpper("abc") -> "Abc"
vowelsToUpper("a") -> "A"

Your Answer:

Reset

Practice a different Java exercise

Feedback

Your feedback will appear here when you check your answer.