Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I have most of it done, I just need help fixing some things. import java.util.Scanner; public class Main { private String[] database;
Description: You are to add the necessary features and class to complete the AddressBook class code provided. See the java file Main.java. The given class must: Add a person to a "database" (an array) Search the database for a person given the name. Delete a person in the database given the name of the person. Display all the people (on the console) in the database using the following format (not in italics): Name Bob Sue Phone Number 451-1234 723-5832 Currently the class contains methods to display the menu (displayMenu()), get the users choice (getChoice()), delete a person from the database (remove()), and a main method to test the features. There are also the UI methods addperson() (which gets the person info to add and calls the add() method), deletePerson() (which gets the name of the person to delete and calls the remove() method), and findPerson() (which gets the name of the person to find and calls the search() method). The method run() runs the UI methods. You will need to provide a search method (which is required by the remove() method), add a person to the database (add()) and displayAll() method to display the records. You will also need to add to findPerson() method your display code of the person found using the same format as displayAll() to display the single record. search(String name) - given the name of the person to find, returns the position of that entry in the address book (database) OR returns -1 indicating not found. add() - given a new person's data (name and phone number) adds it to the address book (database) displayAll() - display all the records in the address book (database) using the described format. Use a spacing of 20 chars for the name and 15 for the phone number and left justify it.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started