Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4 . Write a C + + program to manage your WhatsApp groups. The information of every WhatsApp group will be stored in a linked

4. Write a C++ program to manage your WhatsApp groups. The information of every WhatsApp group will be stored in a linked list containing the phone numbers of each group member. The groups will be stored in an array (max. size 10) that stores the name of the group and the linked list of its members (such as family,05321112222,054433355555,...)
The program should first input the information of your WhatsApp groups from a text file. The first line of every group shows the group name and number of members, followed by the phone numbers of the members.
family 3
05321112222
05423334444
05556667777
friends 2
Then, the user can enter List to list the phone numbers of a group, Change to change the phone number of a person in all groups or Quit to quit the program as shown in the sample run below.
Note: The linked list header file is given on the next page.
Sample Run:
Change | List | Quit: List
Which group? family
05321112222
05423334444
05556667777
Change | List | Quit: Change
Old & new phone numbers:05556667777054411111111
Change | List | Quit: List
Which group? family
05321112222
05423334444
054411111111
1. Change | List | Quit: Quit
Node Header Prototype
template
struct node
{
T info;
node *link;
};
Linked List Header Prototype
template
class LL
{ protected:
node *head,* last;
int count;
public:
LL();
~LL();
bool isEmptyList();
int length();
T back();
T front();
void destroyList();
node* search(T&);
void insertFirst(T&);
void insertLast(T&);
void deleteNode(T&);
friend ostream& operator<<(ostream&, LinkedList&);
};
Doubly Linked List Node Header Prototype
template
struct node
{ T info;
node *right,*left;
};
Doubly Linked List Header Prototype
template
class DLL
{ protected:
node *first,* last;
int count;
public:
DLL();
~DLL();
bool isEmptyList();
int length();T back();T front();void destroyList();
node* search(T&);
void insertFirst(T&);
void insertLast(T&);
void deleteNode(T&);
friend ostream& operator<<(ostream&, DLinkedList&);
};

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

Oracle 10g SQL

Authors: Joan Casteel, Lannes Morris Murphy

1st Edition

141883629X, 9781418836290

More Books

Students also viewed these Databases questions