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
What is the first and last value of i to be displayed by the following code snippet? int n = 20; for (int i = 0; i &lt;= n; i++)
frutty [35]

Answer:

The first value of i is 0 and last value of i is 20.

Explanation:

The following are the description of a given loop.

  • In this problem, there are two loops one is the internal loop and the other is the external loop
  • In the outer loop, the value of " i" is initialized with "0" So the first value is printed 0 in the console.
  • For one value of "i" all the inner loop is executed.
  • The loop is executed is less equal to 20 that's why the last value of "i" is printed 20 in the console window.

6 0
3 years ago
Create a class called Fraction. Provide a constructor that takes 2 integers. Provide methods for:
tekilochka [14]

Answer:

Explanation;

else

System.out.println("f1 and f2 are not equal");

switch (input.charAt(0)

{

case '+':

f3 = f1.add(f2);

System.out.println("f1+f2=" + f3);

break;

case '-':

f3 = f1.subtract(f2);

System.out.println("f1-f2=" + f3);

break;

case '*':

f3 = f1.multiply(f2);

System.out.println("f1*f2="+f3);

break;

case '/':

f3 = f1.divide(f2);

System.out.println("f1/f2="+f3);

break;

default:

System.out.println("Illegal command: " + input );

break;

}

}// end of while loop

} // end of main

}

 

Note ; this is the last part of the programme check the attachment from 1-5  this is the 6th .

8 0
2 years ago
What is the first thing you should do when you discover a computer is infected with malware? The second thing?
Goshia [24]

Answer:

Quarantine the computer.

Explanation:

Malware can be characterized with negative software capable of causing various damages to a computer, such as theft of data and information, in addition to damage to devices.

In order to avoid having your computer infected with malware, it is essential to have installed reliable malware-checking software, in addition to taking all appropriate security measures when accessing the internet and never clicking on unknown or suspicious links.

Therefore, when realizing that the computer has been infected by malware, it is necessary to quarantine the computer and immediately disconnect from a network so that it does not infect other computers. The quarantine acts as an action where the infected file is moved to an encrypted folder where the malware cannot be executed and spread by the operating system.

3 0
3 years ago
How many people in the world
sveticcg [70]

Answer:

Around seven billion people

4 0
2 years ago
Who is the host in super monkey ball?
Savatey [412]

Answer:

Brian

Explanation:

3 0
3 years ago
Other questions:
  • You have implemented a network where hosts are assigned specific roles, such as for file sharing and printing. Other hosts acces
    7·1 answer
  • A user calls your help desk and says that he is trying to configure his Word document so that the text within his paragraphs is
    15·1 answer
  • If you ping a device, you are using the______protocol
    11·1 answer
  • A device capable of copying a graphic, document, or other object is called a
    7·2 answers
  • Read the following paragraph:
    9·2 answers
  • You will implement three different types of FFs with two different reset types. You have to show your results on your FPGA. You
    9·1 answer
  • If i don't update my computer what threat does my computer face?
    6·1 answer
  • What is media ethics. Explain two forms of maintaining media ethics with examples​
    13·1 answer
  • Hardware is found outside the system unit.​
    13·1 answer
  • Have y’all enjoyed The new hero floryn from Mobile legends
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!