Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA Using the Queue ADT: Write a program that repeatedly prompts the user to enter strings, using the string x done to indicate when

image text in transcribedJAVA

Using the Queue ADT: Write a program that repeatedly prompts the user to enter strings, using the string " x done" to indicate when finished. The user is assumed to only enter strings of the form "f name" or "m name." Output the names that had " m " indicated in the same order they were entered, preceded by the string "males:" and then do the same for the names that had " f indicated, preceded by the string "females: ". Use two ArrayBoundedQueue objects in your program. Sample Run Input a gender and name ( x done to quit) > m Fred Input a gender and name ( x done to quit) >f Wilma Input a gender and name ( x done to quit) > m Barney Input a gender and name ( x done to quit) > m BamBam Input a gender and name ( x done to quit) >f Betty Input a gender and name ( x done to quit) >x done males: Fred Barney BamBam females: Wilma Betty

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_2

Step: 3

blur-text-image_3

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

Database And Expert Systems Applications 24th International Conference Dexa 2013 Prague Czech Republic August 2013 Proceedings Part 1 Lncs 8055

Authors: Hendrik Decker ,Lenka Lhotska ,Sebastian Link ,Josef Basl ,A Min Tjoa

2013 Edition

3642402844, 978-3642402845

More Books

Students also viewed these Databases questions