Question: Using NetBeans, write an object-oriented program that implements an address book. This should be a normal Java console application (like the RectangleCalculation exmaple) - do
Using NetBeans, write an object-oriented program that implements an address book. This should be a normal Java console application (like the RectangleCalculation exmaple) - do not write a Tomcat web application for this assignment.
Your program should allow the user to store contact information for people he/she knows. The contact information we want to store is: name, phone number, and e-mail address. Create a Contact class to store this information.
You will also need a main class to contain the logic for your program. This class will store Contact objects in an ArrayList (similar to the RectangleCalculation example).
Your main class should include a menu with the following options:
- Add Contact
- Delete Contact
- Edit Contact
- Display Contacts
- Quit
Add Contact
When the user wants to add a contact, prompt the user for the name, phone number, and e-mail address of the new contact. Create a Contact object, store the information in this object, and add the object to the ArrayList.
Delete Contact
When the user wants to delete a contact, prompt the user for the contact's name. Find the appropriate Contact object in the ArrayList, and remove it from the list.
Edit Contact
When the user wants to edit a contact, prompt the user for the contact's name. Find the appropriate Contact object in the ArrayList, and display that contact's information. Prompt the user to enter new information (name, address, and phone number). Delete the old object from the ArrayList and add a new Contact object at the end of the list. You can assume that your address book does not contain two people with the same name.
Display Contacts
Display the contacts by printing the names, addresses, and phone numbers to the screen. Display the information in a nice, easy-to-read format. Display all the information for the first contact, then the second contact, then the third contact, and so on.
Quit
When the user selects the "Quit" option, your program should end.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
