Page 1 of 1

Write an application in Java that will simulate the contacts apps. The text below shows the details of the application.

Posted: Fri May 20, 2022 11:42 am
by answerhappygod
Write an application in Java that will simulate the contacts
apps. The text below shows the details of the application. Just
like in real contacts apps, a number must be unique to a contact.
Assume that user will not enter invalid inputs.
Create a java application in which the system will run following
tasks:
user will enter 1 to 5
The application will run these:
Welcome to the Contacts
Application
1=List, 2=Add, 3=Update, 4=Delete, 5=Exit :
1
No contacts exist.
1=List, 2=Add, 3=Update, 4=Delete, 5=Exit :
3
Enter first name, last name, or number of the contact :
John
No match found.
1=List, 2=Add, 3=Update, 4=Delete, 5=Exit :
4
Enter first name, last name, or number of the contact:
Smith
No match found.
1=List, 2=Add, 3=Update, 4=Delete, 5=Exit :
2
First Name : John
Last Name : Smith
Telephone # : 1111111
Contact added successfully.
1=List, 2=Add, 3=Update, 4=Delete, 5=Exit :
1
Name.................Telephone Number
John Smith............... 1111111
1=List, 2=Add, 3=Update, 4=Delete, 5=Exit :
2
First Name : Smith
Last Name : Smithson
Telephone #: 3333333
Contact added successfully.
1=List, 2=Add, 3=Update, 4=Delete, 5=Exit :
1
Name..................................Telephone
Number
John Smith
.................................1111111
Leah Smith
.................................2222222
Smith
Smithson..........................3333333
1=List, 2=Add, 3=Update, 4=Delete, 5=Exit :
2
First Name : John
Last Name : Reazor
Telephone # : 3333333
This number already exists in your contacts. It belongs
to Smith Smithson
1=List, 2=Add, 3=Update, 4=Delete, 5=Exit :
1
Name ....................................... Telephone
Number
John Smith .....................................
1111111
Leah Smith
........................................2222222
Smith Smithson
.................................3333333
1=List, 2=Add, 3=Update, 4=Delete, 5=Exit :
2
First Name : John
Last Name : Reazor
Telephone # : 4444444
Contact added successfully.
1=List, 2=Add, 3=Update, 4=Delete, 5=Exit : 1
Name...............................................
Telephone Number
John Smith
.............................................. 1111111
Leah Smith
...............................................2222222
Smith Smithson
........................................3333333
John
Reazor..............................................
4444444
1=List, 2=Add, 3=Update, 4=Delete, 5=Exit :
3
Enter first name, last name, or number of the contact :
John
2 match(es) found:
1: John Smith .........1111111
2: John Reazor......... 4444444
0: Abort
Enter your choice : 0
Update aborted.
1=List, 2=Add, 3=Update, 4=Delete, 5=Exit :
3
Enter first name, last name, or number of the contact :
Smith
3 match(es) found:
1: John Smith........ 1111111
2: Leah Smith......... 2222222
3: Smith Smithson ...........3333333
0: Abort
Enter your choice: 3
1=Update First Name, 2=Update Last Name,
3=Update Number : 3
Enter the new number: 1111111
This number already exists in your contacts. It belongs
to John Smith

1=List, 2=Add, 3=Update, 4=Delete, 5=Exit : 1
Name Telephone Number
John Smith............... 1111111
Leah Schmidt................. 2222222
Smith Smithson .................3333333
John Reazor ..................4444444
AAAAA BBBBB................ 9999999
1=List, 2=Add, 3=Update, 4=Delete, 5=Exit :
4
Enter first name, last name, or number of the contact:
9999999
1 match(es) found:
1: AAAAA BBBBB.................. 9999999
0: Abort
Enter your choice: 1
Contact deleted successfully.
1=List, 2=Add, 3=Update, 4=Delete, 5=Exit :
1
Name..................................... Telephone
Number
John Smith.................................
1111111
Leah Schmidt ...............................
2222222
Smith Smithson............................
3333333
John Reazor ...............................
4444444
1=List, 2=Add, 3=Update, 4=Delete, 5=Exit : 4
Enter first name, last name, or number of the
contact: Smith
2 match(es) found:
1: John Smith ..................... 1111111
2: Smith Smithson ..................3333333
0: Abort
Enter your choice: 1
Contact deleted successfully.
1=List, 2=Add, 3=Update, 4=Delete, 5=Exit :
1
Name..................................... Telephone
Number
Leah Schmidt
.............................2222222
Smith Smithson
...........................3333333
John Reazor.................................
4444444
1=List, 2=Add, 3=Update, 4=Delete, 5=Exit :
5
Bye
D: \>