Skip to content

nsadisha/Anonymous

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Anonymous

Junior hack 3.0

Code Challenge : (Contact list)

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.

1) First print the following lines in the command line.

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

2) Take an input from the user as the selected option.

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.

7) When users select add contact as an option please do the following.

  • 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)

8) When users select edit contact as an option please do the following.

  • 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.)

9) When users select delete contact as an option please do the following.

  • 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.)

10) When users select display contact as an option please display all contacts as the following.

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.



EVALUATION CRITERIA (IMPORTANT)

  • Code structure/ Quality/ usage of OOP concepts
  • For overall functioning of the system

SPECIFICATIONS

  • Language –Java 8 or above

SUBMISSION

  • Through Github(a public repo)

About

Junior hack 3.0

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages