Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Make Java class named Book to build a simple phonebook program that reads in a series of name-number pairs from the user (that is, name

Make Java class named "Book" to build a simple phonebook program that reads in a series of name-number pairs from the user (that is, name and number on one line separated by whitespace) and stores them in a Map from Strings to Integers. The user should enter "quit" when they are finished. Then ask the user for a name and return the matching number, or tell the user that the name wasn't found.  If the user types the input given below(Bill), then your programs output should be "243-7787". If the last line of the user input had been a name not in the original list (e.g., "Aaron"), then your programs output should be "Number not listed." 

 

Dale 572-0423 

Hank 572-8841 

Bill 243-7787 

quit 

Bill

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Big Java, Enhanced Early Objects

Authors: Cay S Horstmann

7th Edition

1119499097, 9781119499091

More Books

Students also viewed these Programming questions

Question

How do you add two harmonic motions having different frequencies?

Answered: 1 week ago