Junior hack 3.0
First year student at Software Engineering University of Kelaniya, is creating a contact list application. He has documented everything to do and he has to give the final product to the client by tomorrow. He is seeking help to do this. As a good friend ofyour team, you are willing to help him.
In this task you need tocreate a regular contact list using java.
Select an Option
- Enter 1 to display all contacts
- Enter 2 to add contact
- Enter 3 to remove contact
- Enter 4 to edit a contact
- Enter 5 to load contacts from a text file.
- Enter 6 to save contacts to the text file.
- Enter 7 to exit from the program
3) When the user selects a number, perform the corresponding task and again print the above optionslike a loop until the user enters7 as input to exit from the program.
4) Create a Contact class with name(String), phoneNo(String) as attributes. (Hint: You may use Encapsulation to create variables)
5) Create a ContactList class with a List of content objects as an attribute. (Hint: You may use Lists )
6) In the ContactList class you may have addContact, deleteContact, editContact, displayContacts, loadContacts, saveContacts as methods.
- Display “Please enter name”
- Then take input for the name
- Display “Please add phone number”
- Then take input for the phone number
- Call the addContact method and add the contact to the List. ( Hint: You may configure the parameters)
- Display “Please enter name of the contact that you want to change”
- Then take input for the name
- Display “Please enter the new phone number”
- Then take input for the new phone number
- Call the editContact method (Hint: You may configure the parameters and add method body accordingly.)
- Display “Please enter name of the contact that you want to delete”
- Then take input for the name
- Call the deleteContact method (Hint: You may configure the parameters and add method body accordingly.)
Eg:-
- Saman 0771111111
- Nimal 0112342335
11) When users select load contacts as an option, call the LoadContacts in the ContactList class and add the contacts to your list. You have to read the file from the local storage. You may add the method body as required.
12) When users select save contacts as an option, call the saveContacts in the ContactList class. You may add the method body as required.
- Code structure/ Quality/ usage of OOP concepts
- For overall functioning of the system
- Language –Java 8 or above
- Through Github(a public repo)