• Post Reply Bookmark Topic Watch Topic
  • New Topic

Help me in my first project  RSS feed

 
diaa baraka
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am required to implement a program to represent a phonebook. The program is required to handle all the common features of phonebooks such as insertion, deletion, editing and searching.
The program should handle all the following operations
1- Add a new contact
2- Edit an existing contact
3- Delete an existing contact
4- View all existing contacts
5- Search for contacts by First Name, Last Name or Phone Number.
6- Save and Load contacts to and from files. The file format is like the following and you must commit to this format.
i've implemented all of above except finally point i want you explain the concept of writing in files and this what i have done until now

 
Kemal Sokolovic
Bartender
Posts: 825
5
Java Python Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please UseCodeTags (<- click) when posting your code. That way you will make your code a lot of easier to read and thus increase chances of getting a good answer. I have added them for you this time.
 
Kemal Sokolovic
Bartender
Posts: 825
5
Java Python Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As for the last part of your task you'll need to show what you have done so far. If you have never implemented reading/writing from/to file, I would suggest you search the official Java tutorial on this topic.

I will take the liberty and comment the rest of your code. It seems ok in some aspects, but do you really want to use first name as an identifier for editing/deleting contact? What if you have two contacts with the same first name, which one will be deleted with your code?

I would also suggest you add toString() method to your Contact class that you could then invoke whenever you want to print information about a contact (which might be useful in viewAllContacts() method).

That search() method also seems a bit strange to me.

You should write a class with a main method, and play with your implementation a little. Also, I must say I don't like seeing no comment(s) in your code...
 
diaa baraka
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks lot for your advices
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!