Exercise: Making a Phone Book

Let's go through what you’ve learned in this chapter.

We'll cover the following

Problem statement

You have some names and telephone numbers on paper and would like to store them in a Rust program for printing.

The data is:

Name Telephone Number Number Type
Jane & John Doe 555-123-4567 Home
Joseph Bloggs 555-111-2222 Work
Rowena Stevenson 555-111-3333 Cell
Marcus Mills 555-111-4444 Cell
Orson Richards 555-111-5555 Cell

Coding challenge

Take some time to determine the best way to solve this problem. You’ll want to create a structure for each person and store it in an array or vector. You then want to print the resulting list.

Get hands-on with 1200+ tech skills courses.