Bernardo J.

asked • 01/27/22

I don't know how to to code this

Good day. I was hopin if you could help me with this java code that includs a priorityqueue and a scanner.

I can't seem to produce an output that make you print the priorityqueue one by one, it only prints them alltogether and I am not that yet good with java. I hope you can help me. Thank you


Instructions:

Create java greeting code

Import scanner and Priority queue from java.util.package

Create one Priorityqueue object name nicknames

the output shall do the following

ask the use to input 4 names

ask the use to press H to say "Hi" to each one of them

Display hi and the classmates name

Sample output :

"

Enter 4 nicknames :

Nika

Berlin

Mark

Kate

Press H to say Hi to each of them : H

Hi Berlin

H

Hi Kate

H

Hi Mark

H

Hi Nika

H

Done saying Hi

"

1 Expert Answer

By:

Jordan W. answered • 01/28/22

Tutor
5 (9)

C++, Java, Algebra, C#, SQL, Python Tutor

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.