Phone directory applications using doubly linked list make a c++ prgram which perform all operations in it

Answers

Answer 1

A C++ program that implements a phone directory using a doubly linked list. The program allows you to perform operations such as adding a contact, deleting a contact, searching for a contact, and displaying the entire phone directory.

```cpp

#include <iostream>

#include <string>

using namespace std;

// Structure for a contact

struct Contact {

   string name;

   string phoneNumber;

   Contact* prev;

   Contact* next;

};

// Class for the phone directory

class PhoneDirectory {

private:

   Contact* head; // Pointer to the head of the list

public:

   PhoneDirectory() {

       head = nullptr;

   }

   // Function to add a contact to the phone directory

   void addContact(string name, string phoneNumber) {

       Contact* newContact = new Contact;

       newContact->name = name;

       newContact->phoneNumber = phoneNumber;

       newContact->prev = nullptr;

       newContact->next = nullptr;

       if (head == nullptr) {

           head = newContact;

       } else {

           Contact* temp = head;

           while (temp->next != nullptr) {

               temp = temp->next;

           }

           temp->next = newContact;

           newContact->prev = temp;

       }

       cout << "Contact added successfully!" << endl;

   }

   // Function to delete a contact from the phone directory

   void deleteContact(string name) {

       if (head == nullptr) {

           cout << "Phone directory is empty!" << endl;

           return;

       }

       Contact* temp = head;

       while (temp != nullptr) {

           if (temp->name == name) {

               if (temp == head) {

                   head = head->next;

                   if (head != nullptr) {

                       head->prev = nullptr;

                   }

               } else {

                   temp->prev->next = temp->next;

                   if (temp->next != nullptr) {

                       temp->next->prev = temp->prev;

                   }

               }

               delete temp;

               cout << "Contact deleted successfully!" << endl;

               return;

           }

           temp = temp->next;

       }

       cout << "Contact not found!" << endl;

   }

   // Function to search for a contact in the phone directory

   void searchContact(string name) {

       if (head == nullptr) {

           cout << "Phone directory is empty!" << endl;

           return;

       }

       Contact* temp = head;

       while (temp != nullptr) {

           if (temp->name == name) {

               cout << "Name: " << temp->name << endl;

               cout << "Phone Number: " << temp->phoneNumber << endl;

               return;

           }

           temp = temp->next;

       }

       cout << "Contact not found!" << endl;

   }

   // Function to display the entire phone directory

   void displayDirectory() {

       if (head == nullptr) {

           cout << "Phone directory is empty!" << endl;

           return;

       }

       Contact* temp = head;

       while (temp != nullptr) {

           cout << "Name: " << temp->name << endl;

           cout << "Phone Number: " << temp->phoneNumber << endl;

           cout << "------------------------" << endl;

           temp = temp->next;

       }

   }

};

int main() {

   PhoneDirectory directory;

   // Example usage

   directory.addContact("John Doe", "1234567890");

   directory.addContact("Jane Smith", "9876543210");

   directory.addContact("Alice Johnson", "5678901234");

   directory.displayDirectory();

   directory.searchContact("Jane Smith");

   directory.searchContact("Bob

Learn more about C++ program here:

https://brainly.com/question/30905580

#SPJ11


Related Questions

Joann wants to save the building block she created for the title of her company.

In which file does she save this building block?

Answers

Answer:

Building Blocks.dotx

Explanation:

Just did it on Edge2020

News programs and documentaries are examples of?​

Answers

Answer:

A documentary film or documentary is a non-fictional motion-picture intended to "document reality, primarily for the purposes of instruction, education, or maintaining a historical record

question an internet user has a need to send private data to another user. which of the following provides the most security when transmitting private data? responses certifying the data with a creative commons license before sending it certifying the data with a creative commons license before sending it sending the data using a high-bandwidth connection sending the data using a high-bandwidth connection sending the data using public-key encryption sending the data using public-key encryption sending the data using redundant routing

Answers

Sending the data using public-key encryption provides the most security when transmitting private data among the given options.

Public-key encryption is a cryptographic technique that uses a pair of keys, a public key and a private key, to encrypt and decrypt data. The public key can be freely distributed, while the private key must be kept secret.

When a user wants to send private data to another user, they can use the recipient's public key to encrypt the data, ensuring that only the recipient can decrypt it with their private key. This provides a high level of security for the transmitted data, as even if intercepted, the data cannot be read by anyone who doesn't possess the private key.

Certifying the data with a Creative Commons license before sending it or sending the data using a high-bandwidth connection do not provide any security measures to protect the private data. Redundant routing can improve the reliability of the transmission, but it does not add any encryption or security measures to protect the private data.

For more question on encryption click on

https://brainly.com/question/30299008

#SPJ11

PLS ANSWER NOW QUICKLY!!!!
If the car can recognize and have an understanding or estimation of more information about the people involved should that influence the decision that is made? To clarify with an example: if the car’s software can recognize that a pedestrian is a mother with two children in a stroller or a pregnant woman, should that be factored into the decision that is made by the software? Why or why not?

Answers

Ethical implications of recognizing vulnerable individuals in autonomous vehicle decision-making

The use of additional information in the decision-making process of an autonomous vehicle raises ethical and moral questions. Recognizing and prioritizing the safety of vulnerable individuals at risk of injury in an accident ensures safety.

Using such information could raise concerns about privacy, bias, and discrimination. The technology used to recognize and understand pedestrians may need to be more accurate and could lead to incorrect decisions or unintended consequences.

Relying on this information could perpetuate existing biases and inequalities, such as prioritizing the safety of specific individuals over others based on their perceived vulnerability.

The decision to factor should consider the potential benefits and risks and an ethical framework that prioritizes safety while considering the rights and dignity of individuals.

Why do we have to watch a video to get answers?

Answers

Answer:

The videos contain the answers.

Explanation:

Hey there!

Watching a video can help understand the concept better. If you watch the video, you will learn more. It's also a  benefit to watch a video. For many people who can't understand, they can learn by watching the video. So this is a good way to understand things better: watching a video.

Hope this helps!

write a function called reverseletters that takes an input phrase consisting of a single word and reverses the sequence of letters between the first letter and last letter. the input phrase could be a character vector of any length. restrictions: the function may not use loops. ex: >> sout

Answers

The implementation of the reverseletters function in Python is as follows:

def reverseletters(input_phrase):

   if len(input_phrase) <= 2:

       return input_phrase

   return input_phrase[0] + input_phrase[-2:0:-1] + input_phrase[-1]

input_phrase = "hello world"

output_phrase = reverseletters(input_phrase)

print(output_phrase)  

Explanation:

This function first checks if the length of the input phrase is less than or equal to 2, in which case the phrase is returned unchanged. Otherwise, it returns the first letter of the input phrase (input_phrase[0]) followed by the reversed sequence of letters between the last letter and the second letter (input_phrase[-2:0:-1]) and finally followed by the last letter of the input phrase (input_phrase[-1]). This implementation assumes that the input phrase consists of a single word with no spaces in the middle. If the input phrase contains spaces or punctuation, the function will not behave correctly.

To know more about function click here:

https://brainly.com/question/31219120

#SPJ11

A modem converts original ________ signals to ________ signals that can travel down the telephone system.

Answers

A modem converts original analog signals to digital signals that can travel down the telephone system.


A modem (modulator-demodulator) is a device that transforms digital signals into analog signals. It enables data transmission via analog telephone lines, which were designed for voice communications, by transforming data from computers or other digital devices into analog signals that can be transmitted over these lines. A modem then transforms the received analog signals back into digital signals, which can then be processed by the computer. Modems are used by both personal and corporate users to connect to the internet, as well as for remote access to systems and services. They are used for many purposes, including high-speed broadband internet access, remote device control, file transfers, and online gaming.

The primary purpose of a modem is to convert digital signals into analog signals so that they can be transmitted over the phone line. This is accomplished by modulating a carrier signal to represent digital bits. A modem is also in charge of demodulating received analog signals back into digital bits. This enables a computer to communicate with another computer via a telephone line.

Learn more about modem here

https://brainly.com/question/7320816

#SPJ11

Write a program in the if statement that sets the variable hours to 10 when the flag variable minimum is set.

Answers

Answer:

I am using normally using conditions it will suit for all programming language

Explanation:

if(minimum){

hours=10

}

Which line of code will allow a decimal point to be stored in a variable?

Answers

Answer:

a float value u mean right?Explanation:

Answer: the answer is A

Explanation:

I got it right on my flvs 3.01 test!!!!!!!!!!!!!

I'LL MARK BRAINLIEST!!! What is the difference between packet filtering and a proxy server?

A proxy filters packets of data; packets filter all data.
Packets filter packets of data; proxy servers filter all data.
Packets filter spam; proxy filters viruses.
A proxy filters spam; packets filter viruses.

Answers

A proxy operates at the application layer, as well as the network and transport layers of a packet, while a packet filter operates only at the network and transport protocol layer

Answer:

The Answer is B. Packets filter packets of data; proxy servers filter all data.

Explanation:

it says it in the lesson just read it next time buddy

Select the term(s) that are considered a function of epithelial tissues by clicking the box(es).

Answers

The terms that are considered a function of epithelial tissues include

absorption

filtration

protection

secretion

What is an epithelial tissue?

The epithelium is a form of body tissue that covers all of the internal and exterior body surfaces, lines hollow organs and body cavities, and makes up the majority of glandular tissue..There are many epithelial tissues in the human body. They make up the majority of the tissue in glands, line body cavities and hollow organs, and cover all of the body's surfaces. Protection, secretion, absorption, excretion, filtration, diffusion, and sensory reception are just a few of the many tasks they carry out.

Protection from the environment, coverage, secretion and excretion, absorption, and filtration are the primary roles of epithelia. Tight junctions, which create an impermeable barrier, connect cells.

Therefore, the terms that are considered a function of epithelial tissues include.absorption, filtration, protection, and secretion.

Learn more about tissue on:

https://brainly.com/question/17301113

#SPJ1

Select the term(s) that are considered a function of epithelial tissues by clicking the box(es).

absorption

filtration

digestion

protection

secretion

What are the three different common divisions of cloud computing?

Answers

Answer:

1-private clouds

2-public clouds

3-hybrid clouds

Why might you want to collect multiple items in the Office Clipboard?

Answers

Answer:

So you have more items to work with.

Explanation:

is a backup copy of the configuration of a pc which a user can revert to if an operational problem arises.

Answers

A restore point is a backup copy of the configuration of a pc which a user can revert to if an operational problem arises.

A restore point is a feature in computer operating systems that allows users to create a snapshot of the system's settings, files, and configurations at a specific point in time. It serves as a reference point that can be used to revert the system back to that particular state if issues or errors occur in the future.

They are typically created automatically by the operating system during certain events, such as the installation of new software or system updates.

Learn more about restore point, here:

https://brainly.com/question/32666274

#SPJ4

what version number of ftp is vulnerable to the smiley face backdoor?

Answers

The Smiley Face backdoor was a security vulnerability that existed in some versions of the FTP (File Transfer Protocol) software. Specifically, it affected versions of the WU-FTPD server software prior to version 2.6.0.

The Smiley Face backdoor allowed remote attackers to gain unauthorized access to an FTP server by including certain smiley face characters in the FTP username. When a user with a smiley face in their username connected to the vulnerable server, the backdoor would execute arbitrary commands with the privileges of the FTP server.

Therefore, it is not a specific version number of FTP that is vulnerable to the Smiley Face backdoor, but rather a specific version of the WU-FTPD server software. The vulnerability was fixed in version 2.6.0 of the software, so any version prior to that is potentially vulnerable.

Learn more about FTP visit:

https://brainly.com/question/30443609

#SPJ11

What are the qualities of strong leaders? Check all that apply. They inspire others. 1)They are easily influenced by others. 2)They are outstanding role models. 3)They have a strong sense of purpose. 4)They lack self-confidence.

Answers

Answer: 2 and 3
Explanation:

I would pick 2 and 3 based on process of elimination

lin installed a time-management utility that she downloaded from the internet. now several applications are not responding to normal commands. what type of malware did she likely encounter?

Answers

Lin likely encountered a Trojan horse malware.

Trojan horse is the type of malware that Lin likely encountered. Trojan horse is a type of malware that is disguised as a legitimate software or application. It tricks the user into downloading and installing it on their computer, and then it performs malicious actions in the background without the user's knowledge. These actions may include stealing sensitive data, damaging the computer, or giving unauthorized access to the attacker.

Therefore, Lin needs to immediately remove the infected software from her computer and run a virus scan to ensure that her computer is free from any other malware or virus.

Learn more about  Trojan horse malware:https://brainly.com/question/14393920

#SPJ11

Your question is incomplete, but probably the complete question is :

Lin installed a time-management utility that she downloaded from the Internet. Now several applications are not responding to normal commands. What type of malware did she likely encounter?

Trojan horse

Worm

Virus

Ransomware

Research various credit cards to find low APR's, transactions fees, annual fees, over limit fees. Report on the card you find

Answers

APR (Annual Percentage Rate): This is the interest rate you will be charged on your credit card balance if you carry it over from month to month. The lower the APR, the less you will pay in interest over time. It is impossible to obtain credit cards information.

What is the APR's and transactions fees about?

Transaction Fees: Some credit cards charge fees for certain types of transactions, such as cash advances or foreign transactions. These fees can add up quickly, so it's important to find a card with low or no transaction fees.

Annual Fees: Some credit cards charge an annual fee for the privilege of using the card. While some premium cards may have high annual fees, there are many credit cards available with no annual fee.

Over Limit Fees: Some credit cards charge a fee if you go over your credit limit. This fee can be significant, so it's important to find a card that doesn't have this fee or that has a high credit limit.

Therefore, It's important to note that there are many different credit cards available, with a wide range of fees and features. It's a good idea to research several different cards to find the one that best suits your needs. It's also good to check the credit card's website for any fees and offers that are not mentioned in the advertisement.

Learn more about APR's from

https://brainly.com/question/1686286

#SPJ1

The Stage is where you see your stories, games, and animations come to life.

True
False

Answers

Answer:

true

Explanation:

True


Explanation:

(Brainliest please Thats if u want)

¿ Porque la madera presenta mayor resistencia a ser cortada en sentido travesal que en sentido longitudinal

Answers

A medida que crece un árbol, la mayoría de las células de madera se alinean con el eje del tronco, la rama o la raíz. Estas células están compuestas por haces largos y delgados de fibras, aproximadamente 100 veces más largas que anchas. Esto es lo que le da a la madera su dirección de grano.

La madera es más fuerte en la dirección paralela al grano. Debido a esto, las propiedades de resistencia y rigidez de los paneles estructurales de madera son mayores en la dirección paralela al eje de resistencia que perpendicular a él

You need a 65% alcohol solution. On hand, you have a 450
mL of a 40% alcohol mixture. You also have 95% alcohol
mixture. How much of the 95% mixture will you need to
add to obtain the desired solution?​

Answers

Answer:

375 ml of 95%  is what we need to obtain the desired solution

Explanation:

Solution

Now

450 ml of 40% alcohol mixture +95% mix of x = 65% (450 +x)

Thus

0.40 * 450 +0.95 x = 0.65 (450 + x)

180 + 0.95 x =0.65 (450 +x)

180 +0.95 x = 292.5 + 0.65 x

So,

0.95 x - 0.65 x = 292.5 - 180

= 0.3 x = 112.5

x =112.5/0.3

x= 375 ml

Therefore, we will need 375 ml of 95% solution

How will Mario know which words are misspelled in his document?

The word would have a red font.
The word would be bold and red.
The word would have a red highlight.
The word would have a red underline.

Answers

Answer:

The word would have a red underline.

Explanation:

Answer:

The word would have a red underline.

Explanation:

How will Mario know which words are misspelled in his document?The word would have a red font.The word

The numeric address indicating a unique computer location on the internet is called __________.

Answers

The numeric address indicating a unique computer location on the internet is called IP address.

Any device on a network can be identified by its IP address, which stands for Internet Protocol. IP addresses are used by computers to connect with one another on different networks and the internet. The 802.15 wireless networking protocol, which is helpful for establishing small personal area networks, is more commonly referred to as Bluetooth (PANs). Using low-power radio-based communication, it can connect up to eight devices within a 10-meter radius and transmit data at up to 722 Kbps in the 2.4-gigahertz (GHz) range. In particular, Bluetooth is competing with other wireless technologies for the 2.4 GHz band, between 2,402 and 2,480 GHz. Because the maximum coverage distance is 10 meters, the technology-enabled devices are referred to as Wireless Personal Area Networks (WPAN).

Learn more about IP address here-

https://brainly.com/question/16011753

#SPJ4

which of the following statements is most true about metadata and interoperability? group of answer choices standardized schemas are more interoperable than customized ones. interoperability is the aspect of a metadata schema that specifies how to properly formatted metadata elements the international mega-thesaurus will ease the vocabulary problem by cross-walking each concept from each major language to all the others now that everything is web-based, interoperability is automatic

Answers

Standardized schemas are more interoperable than customized ones.

Metadata is information that describes data, and it plays a crucial role in interoperability. Interoperability refers to the ability of different systems to work together and share information effectively. In terms of metadata, standardized schemas that have been widely adopted tend to be more interoperable than customized ones. The reason is that standardized schemas are designed to work well with other systems that use the same schema. Additionally, a metadata schema needs to specify how metadata elements should be formatted to ensure interoperability. Finally, while efforts like the International Mega-Thesaurus can help with vocabulary standardization, it's important to remember that effective interoperability requires not just shared vocabulary, but also shared standards for formatting and sharing information.

Learn more about metadata here: bainly.com/question/14699161

#SPJ4

Complete question:

Which of the following statements is most true about metadata and interoperability.

Now that everything is Web-based, interoperability is automatic

Interoperability is the aspect of a metadata schema that specifies how to properly formatted metadata elements

The International Mega-Thesaurus will ease the vocabulary problem by cross-walking each concept from each major language to all the others

Standardized schemas are more interoperable than customized ones.

What are three advantages of using desktop software on a desktop computer
rather than mobile software on a smartphone or tablet?
A. It is extremely portable and easy to transport.
B. Using a mouse allows more precision when selecting objects on
the screen.
C. It is easier to type in text quickly using a keyboard.
D. It offers more features, and the interface fits well on a bigger
screen.

Answers

Answer:

A. It offers more features, and the interface fits well on a bigger screen.

B. Using a mouse allows more precision when selecting objects on the screen.

C. It is easier to type in text quickly using a keyboard.

Which of the following is not formatted properly?

Which of the following is not formatted properly?

Answers

Answer:

Um, the last one should be it, there isn't any closing paragraph. But the second one is also weird because the comment is not properly finishes. The comment should be <!-- Sth -->

For the following code, what would be the value of str[2]? String[] str = ("abc" , "def", "ghi", "jkl"); a reference to the String object containing "ghi"
"ghi"
a reference to the String object containing "def"
"def"

Answers

The value of str[2] in the given code would be "ghi". This is because the square bracket notation is used to access elements in an array, and in this case, str is an array of Strings. So str[2] refers to the third element in the array, which is "ghi".

It is important to note that str[2] is a reference to the String object containing "ghi", not the actual String itself.In the given code, an array of strings is declared and initialized with four elements: "abc", "def", "ghi", and "jkl". The indexing of arrays in Java starts from 0, so str[2] refers to the third element of the array, which is "ghi". Therefore, the value of str[2] would be "ghi".

To learn more about array click the link below:

brainly.com/question/14983404

#SPJ11



Which of the following is typically an advantage of configuring your own hosting server over using an ISP or a cloud service provider?
А
o
You do not need to purchase software.
B
Configuring your own servers will take less time.
С
You do not need to purchase hardware.
D
You have more choices in the configuration

Answers

Answer:

D that's the answer it has to be

How do you find binary?

Answers

Answer:

To convert integer to binary, start with the integer in question and divide it by 2 keeping notice of the quotient and the remainder. Continue dividing the quotient by 2 until you get a quotient of zero. Then just write out the remainders in the reverse order.

Explanation:

how would you deploy network connectivity in the 25 classrooms, 12 faculty offices, and the common areas of the building?

Answers

The number of ways to deploy network connectivity in the 25 classrooms, 12 faculty offices and a common area is 5200300 ways

How to distribute network connectivity?

We should know that  permutation relates to the act of arranging all the members of a set into some sequence or order

The given parameters are

25 classrooms

12 faculty offices and 1 common area

⇒ n\(_{P_{r} }\)

= \(\frac{25!}{(25-12)!13!}\)

= \(\frac{25*24*23*22*21*20*19*18*17*16*15*14}{y13*11*10*9*8*7*6*5*4*3*2*1}\)

Simplifying the expression we have

5200300 ways

Therefore, the network connectivity can be done in 5200300 ways

Read more about permutation and combination on https://brainly.com/question/1216161

#SPJ1

Other Questions
An S corporation is generally set up to: a.implement an expansion strategy b.attract capital c.reduce tax burdens d.easy entry into an industry e.take advantage of limited liability How did developers like William levity meet the need for housing Each of the following is an example of a type of play for preschoolers except _____. arough-and-tumble play boutdoor play cconstructive play dpretend play It is estimated that about 7,476 African cheetahs are living in the wild today andthe population is expected to decline at a rate of 8.0% per year. Predict the numberof African cheetahs living in the wild in 13 years. Round answer to whole number. NO LINKS PLZ HELP what do museums provide that smaller galleries and private collections may not offer? plsssssss help me....... Determine the amount of money in a money market account providing an annual rate of 6.5 % compounded daily if the invested amount of $3,500 is left in the account for 5 years . 6. The x-coordinate of the vertex is given by -b/2a. Use this information to determine the vertex of each quadratic functiona) y = x2 + 6x + 2what is the y coordinate of the vertex? the white solid is a compound explain the difference between mixture of zinc and sulfur are the compound formed by the chemical reaction between them f(x)= 2/3x+5 for f(15)solve for f(15) pls help im taking a test rn and failing my grade Q-Q Do all of these have a body system? Worm, bird, ant, fly, bacteria what parts of north america need not be concerned about local volcanic eruptions If |z| = 1, where z = x + yi ... find the real part of the number 1 / z-1?? our town act 2 select all that apply. the stage manager's monologue about the day's events is similar to that in act i. which events below does it include? he describes mrs. gibbs and mrs. webb as they begin breakfast. howie newsom is still delivering the milk. he describes howie newson's argument with mrs. gibbs. he describes emily and george's feelings for one another. Will someone help me please?!?! Why did Jesus denounce the Pharisees more than he did any other group? A. They did not teach Scriptures other than the law of Moses. B. They were hypocrites who taught the law but did not keep it themselves. C. They did not believe in the coming of the Messiah and His kingdom. D. They were very proud and concerned only about appearances, not the heart. More than one answer!!! ACME, a small consulting firm has taxable income that places it in the 25% federal income tax bracket and at the 12% state incremental tax rate. The firm has a gross revenue of $550,000, and expenses totaling $378,000.a. What is the combined marginal tax rate?b. What is the combined state and federal taxes?Need: setup, calculations The most common form of competition is ________blank, in which many firms compete for customers in a given market but with differentiated products. Suppose an investment is equally likely to have a 35% return ora 20% return. The variance on the return for this investment isclosest to:A .151.B 0.C .0378.D .075. how many moles of copper are there in the copper sample shown! The diagram shows the ratio of trees Maeve plants to the trees she harvests each day.All of the following diagrams represent equivalent ratios.Which diagram best shows how many trees Maeve planted on a day when she harvested 14 trees?Choose 1 answer: