Skip to main content

Checkpoint: Name Analyzer

Challenge on lesson: Checkpoint: Name Analyzer

CHALLENGE
Difficulty: beginner+25 XP

The Name Analyzer crunches names with the full string toolbox. Implement: 1. static String initials(String first, String last) โ€” both initials upper-cased with a dot between: initials("ada","lovelace") is "A.L.". Null or blank parts are skipped entirely (initials(null,"hopper") is "H."; both blank โ†’ ""). 2. static int vowelCount(String text) โ€” count a e i o u in any case. 3. static String maskEmail(String email) โ€” replace everything before and including the @ with "***@"; input without @ comes back unchanged. maskEmail("ada@example.com") is "***@example.com". 4. static boolean isUsername(String s) โ€” a valid username is 3โ€“16 characters, letters/digits/underscore only, and does NOT start with a digit. Null is invalid.

Back to lesson: Checkpoint: Name Analyzer