Description:    Create (Java Program) 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. **********

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Description:    Create (Java Program) 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 4 steps with 10 images

Blurred answer
Knowledge Booster
Stack operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education