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

JAVA Using the Queue ADT: Write a program that repeatedly prompts theJAVA

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!