Question: Please code the following in java. Make the following modifications/enhancements to Version 0 of the Phonebook application: The phonebook should now contain first name as

Please code the following in java.

Please code the following in java. Make the following modifications/enhancements to Version0 of the Phonebook application: The phonebook should now contain first name

Make the following modifications/enhancements to Version 0 of the Phonebook application: The phonebook should now contain first name as well as a last name. The format of the entries in the file should be: Last-name first-name phone-number The lookup process now prompts for both a last and a first name A reverse lookup should also be provided, allowing a name to be obtained by supplying the phone number. Rather than continuing until the user signals end-of-file (at the keyboard), the user enters a 'q' to indicate they are done After the user is done, the number of lookups and reverse lookups performed are printed Even though we introduce the terms state and behavior in the context of classes, the terms are still relevant here: the state by which we mean variables is enhanced via the introduction of a first name. Similarly, the behavior - i.e., methods is enhanced through the introduction of a reverse lookup, as well as an enhanced name lookup (first and last). The name of your class should be Phonebook. For example, if the file phonebook.text contains: Arnow David 123-456-7890 Harrow Keith 234-567-8901 Jones Jackie 345-678-9012 Augenstein Moshe 456-789-0123 Sokol Dina 567-890-1234 Tenenbaum 678-901-2345 Weiss Gerald 789-012-3456 Cox Jim 890-123-4567 Langsam Yedidyah 901-234-5678 Thurm Joseph 012-345-6789 Aaron Here is a sample execution of the program. User input is in bold. Your program should replicate the prompts and output: lookup, reverse-lookup, quit (1/r/q)? I last name? Arnow first name? David David Arnow's phone number is 123-456-7890 lookup, reverse-lookup, quit (1/r/q)?r phone number (nnn-nnn-nnnn)? 456-789-0123 456-789-0123 belongs to Augenstein, Moshe lookup, reverse-lookup, quit (1/r/q)? I last name? Weiss first name? Jerrold -- Name not found lookup, reverse-lookup, quit (1/r/q)? I last name? Weiss first name? Gerald Gerald Weiss's phone number is 789-012-3456 lookup, reverse-lookup, quit (1/r/q)?r phone number (nnn-nnn-nnnn)? 111-123-4567 -- Phone number not found lookup, reverse-lookup, quit (1/r/q)?q 3 lookups performed 2 reverse lookups performed

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!