betical order and are to be numbered 1, 2, and so on in the standard output stream. In alphabetical or dictionary order (unlike lexicographic order), case of a letter is considered only after the letter itself: b < B < c; and diacritic

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

JAVA Task, by using ArrayList

 

The program reads manatee names from the standard input stream and from time to time prints a sorted portion of the list of names. All the manatee names in the input are given in the order in which the necropsy was performed. You can imagine a unique timestamp associated with each necropsy. The names are not necessarily unique (many of the manatees have the same name). Interspered in the standard input stream are queries that begin with the question mark character. Queries ask for an alphabetical list of manatee names to be printed to the standard output stream. The list depends only on the names upto that point in the input stream and does include any manatee names that appear in the input stream after the query.

The list does not contain all the names of the previous necropsies, but only a selection of them. A query provides the names of two manatees, say A and B. The response to the query drops necropsies performed before the first named A and all the necropsies performed after the last one named B. In the response, the names are to be in alphabetical order and are to be numbered 1, 2, and so on in the standard output stream.

In alphabetical or dictionary order (unlike lexicographic order), case of a letter is considered only after the letter itself: b < B < c; and diacritics are likewise secondardy characteristics: u < ü < v

 

Read all input from the standard input stream. Write all output to the standard output stream. Manatee names do not contain white space. For each query a numbered list is printed, unless one or the other or both manatee are not found in the previous input. In which case, print the line "Not found".

In the case that both names are found, but the reponse is empty, print the line "Empty list".

Input
A_Mantee
? A_Manatee Hugh_Manatee
? Manfred_Manatee Hugh_Manatee
Manfred_Manatee
? Manfred_Manatee Hugh_Manatee
Hugh_Manatee
? Manfred_Manatee Hugh_Manatee
? Hugh_Manatee Manfred_Manatee
? Hugh_Manatee Hugh_Manatee
Output
Not found
Not found
Not found
1: Hugh_Manatee
2: Manfred_Manatee
Empty List
1: Hugh_Manatee
Transcribed Image Text:Input A_Mantee ? A_Manatee Hugh_Manatee ? Manfred_Manatee Hugh_Manatee Manfred_Manatee ? Manfred_Manatee Hugh_Manatee Hugh_Manatee ? Manfred_Manatee Hugh_Manatee ? Hugh_Manatee Manfred_Manatee ? Hugh_Manatee Hugh_Manatee Output Not found Not found Not found 1: Hugh_Manatee 2: Manfred_Manatee Empty List 1: Hugh_Manatee
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY