I have most of it done, I just need help fixing some things. import java.util.Scanner; public class
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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. 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.
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
answer the question clearly You are building a flight-control system for which a convincing safety case must be made. Would you assign the tasks of safety requirements engineering, test case...
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
What is the difference between MouseListener and MouseAdapter? [3 marks] (b) Via suitable HTML, the compiled version of the following Java code is presented to the appletviewer application: import...
-
Ebrahim Patel is a wholesaler who uses the periodic inventory system to account for inventory. Transactions for February: 1 Bought inventory from Rich Traders for R5 000 on credit. 2 Sold inventory...
-
(a) Explain how pyrrole is isoelectronic with the cyclopentadienyl anion. (b) Specifically, what is the difference between the cyclopentadienyl anion and pyrrole? (c) Draw resonance forms to show the...
-
Zafgen, Inc., is a biopharmaceutical company that sells Beloranib, an anti-obesity drug. Following the death of a clinical patient taking Beloranib and the subsequent hold placed on the drug trial by...
-
Two positively charged particles 1 and 2 are moving in the same plane, with the velocity of particle 1 perpendicular to the velocity of particle 2. At the instant shown in Figure P28.9, particle 2 is...
-
Stocks X and Y have the following probability distributions of expected future returns: a. Calculate the expected rate of return, rY, for Stock Y (rX = 12%).b. Calculate the standard deviation of...
-
1. If the wavelength of a-line of Lyman series in hydrogen atom is , find the wavelength of -line of Paschen series. 3256 (b) 36x5 22 (c) 3522 26 (d) 32 x5 26 2. If temperature of a liquid is...
-
Start your valuation analysis with the estimation of expected return using CAPM. You need 3 inputs to calculate the CAPM expected return. 1. An Estimate of the company's Beta Use the daily closing...
-
Write a Java program that uses the database tables from the invoice database in Section 24.2. Produce a report that lists all customers, their invoices, the amounts paid, and the unpaid balances.
-
Given an Optional, what are three different ways of printing it when it is present and not printing anything when it isnt? Which of these can be adapted to print the string "None" if no string is...
-
After several years of internal debate, the Steig Primary Group has decided to offer a walk-in clinic for patients. Many of the physicians were not happy with the change as it meant that one day a...
-
Give SQL commands to create a Car table, with columns for the vehicle identification number, manufacturer, model, and year of each car, and to insert all cars that your family members own. Exercises ...
-
What is the difference between these two expressions? words.filter(w ->w.length() > 10). limit (100).count() words. limit (100).filter(w w.length() >10).count()
-
Respond to the following scenario: As a start-up company, should sonic use indirect or direct exporting, licensing, joint ventures, or direct investment to enter the canadian market next year? to...
-
CdF2 (s) Cd+ (aq) + 2 F- (aq) 1. A saturated solution of CdF2 is prepared. The equilibrium in the solution is represented above. In the solution [Cd+] eq = 0.0585 M and [F-] eq = 0.117 M. a....
-
Explain how the control variate technique is implemented.
-
Suppose that in September 2013 a company takes a long position in a contract on May 2014 crude oil futures. It closes out its position in March 2014. The futures price (per barrel) is \($88.30\) when...
-
A U.S. Treasury bond pays a 7% coupon on January 7 and July 7. How much interest accrues per \($100\) of principal to the bond holder between July 7, 2013, and August 9, 2013? How would your answer...
Study smarter with the SolutionInn App