A Problem Solved: Extracting Strings

In this lesson, we will explore how we debugged a program to solve a given problem.

Problem statement

Read a person’s name as a string, compute its length, identify the first and last names, and obtain the person’s initials. If the name is typed on one line, insist that only one space occur between the two names.



We already solved this problem in the chapter Using Classes and Objects, but this time we’ll make some mistakes and see how to find them.

Get hands-on with 1200+ tech skills courses.