PHONE DIRECTORY Description:   Create a phonebook directory that will store the contact numbers of N persons. Your program should allow the user to add, view, delete, and update the contacts in the phonebook. Note that one person can have multiple contact numbers. The program will stop when the user command is ‘X’. Program command and entry should not be case-sensitive. That means commands ‘I’ or ‘i’ and the name “Jacky” or “JACKY” are the same. Each contact number can be 7 digits or 11 digits only.     The user should input a string containing the command, name, and contact number(s) (Limit the contact number of each person to three). This string should be broken down into fields in order to separate the different values and store them in their appropriate variables.  Use linked list in the implementation. Your node must declare at least four instance variables.   Program flow:     Command> I Jacky 09211234567 Remarks: New contact has been added. Command> V Jacky Contact Number(s): 09211234567 Command> I Jacky 09221234567 Remarks: New number has been added. Command> V Jacky Contact Number(s): 09211234567, 09221234567 Command> I Chan 09212233145 09199876543 Remarks: New contact has been added. Command> I Chan 09211234567 Remarks: New number has been added. Command> V Chan Contact Number(s): 09212233145, 09199876543, 09211234567 Command> V Phonebook directory: Chan - 09212233145, 09199876543, 09211234567 Jacky – 09211234567, 09221234567 Command> D Jacky Remarks: Jacky has been removed. Command> V Phonebook directory: Chan - 09212233145, 09199876543, 09211234567 Command> I Remarks: Invalid command. Command> D Remarks: Invalid command. Command> A Remarks: Invalid command. Command> M Chan John //This will change the name Chan to John Remarks: Chan has been modified. Command> M John 09212233145 09332233252 Remarks: John has been modified. Command> V John Contact Number(s): 09332233252, 09199876543, 09211234567 Command> D John Contact Number(s): 09332233252, 09199876543 Command> X   Legend: I – means add a new contact or add a new number to existing contacts. D – means delete existing contact/number. Command D should always be followed by the contact's name or contact's name and number.. V – means view by contact(s). If command V is followed by a name, then view specific contact only. Otherwise, view all contacts in the directory and display them in ascending order according to their contact name. M – means modify specific contact. Users can change the name or contact number(s) of the said contact. X – means exit. **********Any other command is considered as invalid. **********

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

PHONE DIRECTORY

Description:   Create a phonebook directory that will store the contact numbers of N persons. Your program should allow the user to add, view, delete, and update the contacts in the phonebook. Note that one person can have multiple contact numbers. The program will stop when the user command is ‘X’. Program command and entry should not be case-sensitive. That means commands ‘I’ or ‘i’ and the name “Jacky” or “JACKY” are the same. Each contact number can be 7 digits or 11 digits only.

 

 

The user should input a string containing the command, name, and contact number(s) (Limit the contact number of each person to three). This string should be broken down into fields in order to separate the different values and store them in their appropriate variables.

 Use linked list in the implementation. Your node must declare at least four instance variables.

 

Program flow:
 

 

Command> I Jacky 09211234567 Remarks: New contact has been added. Command> V Jacky Contact Number(s): 09211234567 Command> I Jacky 09221234567 Remarks: New number has been added. Command> V Jacky Contact Number(s): 09211234567, 09221234567 Command> I Chan 09212233145 09199876543 Remarks: New contact has been added. Command> I Chan 09211234567 Remarks: New number has been added. Command> V Chan Contact Number(s): 09212233145, 09199876543, 09211234567 Command> V Phonebook directory: Chan - 09212233145, 09199876543, 09211234567 Jacky – 09211234567, 09221234567 Command> D Jacky Remarks: Jacky has been removed. Command> V Phonebook directory: Chan - 09212233145, 09199876543, 09211234567 Command> I Remarks: Invalid command. Command> D Remarks: Invalid command. Command> A Remarks: Invalid command. Command> M Chan John //This will change the name Chan to John Remarks: Chan has been modified. Command> M John 09212233145 09332233252 Remarks: John has been modified. Command> V John Contact Number(s): 09332233252, 09199876543, 09211234567 Command> D John Contact Number(s): 09332233252, 09199876543 Command> X
 
Legend:
I – means add a new contact or add a new number to existing contacts.
D – means delete existing contact/number. Command D should always be followed by the contact's name or contact's name and number..
V – means view by contact(s). If command V is followed by a name, then view specific contact only. Otherwise, view all contacts
in the directory and display them in ascending order according to their contact name.
M – means modify specific contact. Users can change the name or contact number(s) of the said contact.
X – means exit.
**********Any other command is considered as invalid. **********
Expert Solution
steps

Step by step

Solved in 2 steps with 9 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY