Paul's Tutorials - logo2-3Structures



Reading

Go here:
Structures
and read through the whole page.

Extra Reading

Companion Video

Practice

Once you feel comfortable with the above content, complete the following practice program.

User Info

Write a program that asks for a user first name, last name, street number, street name, city, state, zip code, phone number, and favorite flavor of bubble gum separately. Use a structure to store this info.

Then create a menu (like the one below) to allow the user to choose which piece of data from the structure to view. Once a selection has been made display the piece of data.

Example

What would you like to know about <Display first and last name here>:

  1. Full Address
  2. Phone Number
  3. Favorite flavor of bubble gum


>>> <1, 2, or 3>

You may want to take a look at input validation.

Extra Practice

Allow the user to input information on any number of people. (HINT: use an array!)


← 2-2 Arrays 2-3 Structures Chapter 3: Advanced C++ →