Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Java program that repeatedly prompts the user to enter strings, using the string x done to indicate when finished. The user is assumed

Write a Java 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 CS-stName, SE-stName, CCC- stName or DSAI-stName. Output the names that had CS indicated in the same order they were entered, preceded by the string CS students: , and then do the same for the names that had SE indicated, preceded by the string SE students: . Do the same to the names that had CCC indicated, preceded by the string CCC students: , and for the names that had DSAI indicated, preceded by the string DSAI students: Use four ArrayUnboundedQueue objects in your program.

image text in transcribed

Write a Java 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 "CS-stName", "SE-stName", "CCCstName" or "DSAI-stName". Output the names that had "CS" indicated in the same order they were entered, preceded by the string "CS students: ", and then do the same for the names that had "SE" indicated, preceded by the string "SE students:". Do the same to the names that had "CCC" indicated, preceded by the string "CCC students ", , and for the names that had "DSAI" indicated, preceded by the string "DSAI students: " Use four ArravUnboundedQueue objects in your program. Sample Run: Output - Queue hw (run) \#2 zun: Enter a name (CS, SE, CCC, or DSAI) or x-done to finish: CS-Akram Enter a name (CS, SE, CCC, or DSAI) or x-done to finish: SE-Sami Enter a name (CS, SE, CCC, or DSAI) or x-done to finish: DSAI-Aktham Enter a name (CS, SE, CCC, or DSAI) or -done to finish: CCC-Asal Enter a name (CS, SE, CCC, or DSAI) or -done to finish: DSAI-Zahran Enter a name (CS, SE, CCC, or DSAI) or x-done to finish: CS-Hala Enter a name (CS, SE, CCC, or DSAI) or x-done to finish: SE-Basel Enter a name (CS, SE, CCC, or DSAI) or x-done to finish: x-done cS students: Akram Hala SE students: Sami Basel cCC students: Asal DSAI students: Aktham Zahran BUILD succESSFUL (total time: 47 seconds)

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

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

More Books

Students also viewed these Databases questions

Question

What is Poka Yoke? AppendixLO1

Answered: 1 week ago

Question

=+What do you want them to think?

Answered: 1 week ago