Skip to main content

Checkpoint: Name Analyzer

beginner45 min readLesson 29 of 180

Initials, vowels, email masking, and username validation — the full string toolbox under boundary pressure.

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.