1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
dexar [7]
3 years ago
9

A contact list is a place where you can store a specific contact with other associated information such as a phone number, email

address, birthday, etc. Write a program that first takes as input an integer N that represents the number of word pairs in the list to follow.Word pairs consist of a name and a phone number (both strings). That list is followed by a name, and your program should output the phone number associated with that name.
Computers and Technology
1 answer:
NikAS [45]3 years ago
8 0

Answer:

C++.

Explanation:

<em>Code snippet.</em>

#include <map>

#include <iterator>

cin<<N;

cout<<endl;

/////////////////////////////////////////////////

map<string, string> contacts;

string name, number;

for (int i = 0; i < N; i++) {

   cin<<name;

   cin<<number;

   cout<<endl;

   contacts.insert(pair<string, string> (name, number));

}

/////////////////////////////////////////////////////////////////////

map<string, string>::iterator it = contacts.begin();

while (it != contacts.end())  {

   name= it->first;

   number = it->second;

   cout<<word<<" : "<< count<<endl;

   it++;

}

/////////////////////////////////////////////////////////////////////////////////////////////////////////

I have used a C++ data structure or collection called Maps for the solution to the question.

Maps is part of STL in C++. It stores key value pairs as an element. And is perfect for the task at hand.

You might be interested in
1. List three tabs that make up the Ribbon
Roman55 [17]

Answer:

To create actions panes

On the Project menu, choose Add New Item.

In the Add New Item dialog box, select ActionsPaneControl, and then choose Add.

The ActionsPaneControl1.cs or ActionsPaneControl1.vb file opens in the designer.

From the Common Controls tab of the Toolbox, add a label to the designer surface.

In the Properties window, set the Text property of label1 to Actions Pane 1.

Repeat steps 1 through 5 to create a second actions pane and label. Set the Text property of the second label to Actions Pane 2.

Explanation:

hope it helps

3 0
3 years ago
DIRECTIONS: Organize your desktop. Name the 5 folders based on the files given below. Organize your own desktop by sorting the g
dem82 [27]

Answer: Music, Documents, PowerPoints, Pictures/Videos, Audios

6 0
3 years ago
Which of the following would a high school graduate interested in the performing arts most likely do after graduation?
pashok25 [27]

Answer: College

Explanation: I got it right on my quiz

3 0
3 years ago
How would I collect a number from the user to use for the radius of a circle?
exis [7]

Answer:

C is the correct answer to your question

7 0
2 years ago
Point giveaway and brainliest
melamori03 [73]

Thank you, pal!

You are invited to my clubhouse!

5 0
3 years ago
Read 2 more answers
Other questions:
  • HELP ASAP!!!!!!!!! ITS A UNIT TEST: WILL MARK AS BRAINLIEST&gt;
    13·1 answer
  • To move to the bottom of a document window, press the ____ key(s). ALT CTRL PAGE DOWN CTRL PAGE DOWN ALT PAGE DOWN PAGE DOWN
    11·1 answer
  • Consider the partially-filled array named a. What does the following loop do? (cin is a Scanner object)int[] a = {1, 3, 7, 0, 0,
    6·1 answer
  • A 'array palindrome' is an array which, when its elements are reversed, remains the same (i.e., the elements of the array are sa
    6·1 answer
  • Implement a class Product. A product has a name and a price, for example new Product("Toaster", 29.95). Supply methods getName,
    14·2 answers
  • How to open a new word proccessing document
    9·1 answer
  • 2. Write a Python regular expression to replace all white space with # in given string “Python is very simple programming langua
    14·1 answer
  • Discuss seven multimedia keys​
    8·1 answer
  • Can someone send me reference on communication, importance , communication cycle , pros and cos​
    15·1 answer
  • Debugging 2.17.3: Debug: The Two Towers Code Hs
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!