Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribedimage text in transcribed

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

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

More Books

Students also viewed these Databases questions

Question

2. Discuss various aspects of the training design process.

Answered: 1 week ago

Question

5. Discuss the key roles for training professionals.

Answered: 1 week ago