Модуль: Learning AP CS A with AI


Implement Two Text Utility Methods in TextUtil

Итог: 0 / 9 баллов
Тренировка — проверяйте части и берите подсказки по ходу.
Условие
You are writing small text utilities for a class called `TextUtil`. Implement the two methods described below. You may assume every input is non-null.
 
Дан код
// Methods are inside class TextUtil. Assume all inputs are non-null.
Часть (a) · 4 б.
Write countVowels(String word): return the number of vowels (a, e, i, o, u, upper or lower case) in word.
Часть (b) · 5 б.
Write initials(String fullName): words are separated by single spaces; return the uppercase first letter of each word as a String (e.g. "ada lovelace" -> "AL").