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
Naseer has inserted an image into his document but needs the image to appear on its own line.
Natalija [7]
I don't know if this will answer your question, however, if using Google Docs, it is as simple as selecting the line you wish the image to be on, and navigating to the insert tab. Located in the INSERT tab, there should be a Image button. Click that, and either upload from the web, or from your device.
8 0
2 years ago
Read 2 more answers
What two variables does mass depend on?
Ber [7]

Answer:       The answer to your question would be A

have a good day

Explanation:

4 0
3 years ago
Suppose you have an int variable called number. What Java expression produces the second-to-last digit of the number (the 10s pl
Elden [556K]

Answer:

(number%100) / 10

(number%1000) / 100

Explanation:

5 0
3 years ago
Which of these statements performs real number quotient division using type casting?
lara [203]

Answer:

Double x = 35 / 10;

Explanation:

Java provides simple data types for representing integers, real numbers, characters, and Boolean types. These types are known as _ or fundamental types.

<3

3 0
2 years ago
Even closed systems are never perfectly closed. <br>true false​
Oxana [17]

Answer:

True

Explanation:

You can learn through many different textbooks that a closed system is always closed.

3 0
2 years ago
Other questions:
  • Marisol manages the online advertising campaigns for a chain of toy stores with both a physical and an online presence. Which Go
    7·1 answer
  • What computer system was the first to run the unix operating system?
    11·1 answer
  • Temporary storage location for cutting and pasting
    9·1 answer
  • Oxygen-18 has an atomic number of 8. How many neutrons are in this isotope?
    7·1 answer
  • Marginal ________ shows how much money can be made if a producer sells one additional unit of a good.
    7·2 answers
  • Which of the following is the core of an operating system that maintains the computer’s clock, starts applications, and assigns
    5·1 answer
  • In our discussion of Computer Hardware, we talked about three essential hardware components that are there inside every computer
    14·1 answer
  • How can a user access the Mailbox Cleanup tools?
    11·2 answers
  • Why are control components necessary in traditional software and generally not required in object-oriented software?​
    11·1 answer
  • What does advance mean​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!