Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write this code in Java Make the following modifications/enhancements to Version 0 of the Phonebook application: . The phonebook should now contain a first name

Write this code in Java

image text in transcribed

Make the following modifications/enhancements to Version 0 of the Phonebook application: . The phonebook should now contain a first name as well as a last name. The format of the entries in the file should be last-pame firat-pase 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: David Keith 123-456-7890 234-567-8901 Jacki 345-678-9012 456-789-0123 567-890-1234 678-901-2345 Gerald 789-012-3456 890-123-4567 Yedidyah 901-234-5678 Joseph 012-345-6789 Augenstein Moshe Dina Sokol Neiss Langsam Jim Thurm 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 (Wr/q)? I last name? Arnow first name? David David Arnow's phone number is 123-456-7890 lookup, reverse-lookup, quit (Wr/q)? r phone number (nnn-nnn-nnnn)? 456-789-0123 456-789-0123 belongs to Augenstein, Moshe lookup, reverse-lookup, quit (Wr/q)? I last name? Weiss first name? Jerrold Name not found lookup, reverse-lookup, quit (Wr/q)? I last name? Weiss first name? Gerald Gerald Weiss's phone number is 789-012-3456 lookup, reverse-lookup, quit (Wr/q)? r phone number (nnn-nnn-nnnn)? 111-123-4567 - Phone number not found lookup, reverse-lookup, quit (Wr/q)? q 3 lookups performed 2 reverse lookups performed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Sql++ For Sql Users A Tutorial

Authors: Don Chamberlin

1st Edition

0692184503, 978-0692184509

More Books

Students also viewed these Databases questions