Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get StartedRecommended Textbook for
Big Java, Enhanced Early Objects
Authors: Cay S Horstmann
7th Edition
1119499097, 9781119499091
Students also viewed these Programming questions
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
View Answer in SolutionInn App