Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Write a program that keeps track of a telephone directory. The program should create a structure, Person, with the following data: struct Person {

1. Write a program that keeps track of a telephone directory. The program should create a structure, Person, with the following data:

struct Person { 
 string firstName; string lastName; string phoneNumber; 

};

  1. The program should then create a vector of Person structs, called directory. Your program should have functions to(2 separate functions should be made for the following below)

    • - Read the vector data from a data file telephoneData.txt into the vector directory.

    • - Print the details of all Persons in the vector.

You may use the following telephoneData.txt file:

Tom Garcia 855-433-2076 Nancy James 202-872-1010 Bill Meyer 120-343-5623 Jack Didier 352-654-1983 

Your program should print something like this:

Name Telephone Tom Garcia 855-433-2076 Nancy James 202-872-1010 Bill Meyer 120-343-5623 Jack Didier 352-654-1983 
 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Brief the importance of span of control and its concepts.

Answered: 1 week ago

Question

What is meant by decentralisation?

Answered: 1 week ago

Question

Write down the Limitation of Beer - Lamberts law?

Answered: 1 week ago