← Back to Week 2 Hub
Workbook 2a — Exercise 2

Full Name Parser

Take a full name as one string and split it into its individual parts  |  Workbook p.15

What You're Building

Ask the user to enter their full name as a single string. Your program needs to break it apart into first name, middle name, and last name. Some people have a middle name and some don't — your program should handle both cases correctly.

Example Run
Run 1 — Three-part name
Enter your full name: Dana L. Wyatt

First name: Dana
Middle name: L.
Last name: Wyatt
Run 2 — Two-part name (no middle)
Enter your full name: Dana Wyatt

First name: Dana
Middle name: (none)
Last name: Wyatt
Concepts You'll Use
Flow Diagram
Get full name
Trim input
Find spaces
Extract parts
Display each part

Workbook 2a, p.15 — Exercise 2: Full Name Parser

← Full Name Generator HighScore Wins →