Question: please help with this java assignment: Ken's office hours are getting really full, and a long line is forming outside his office each time. The

please help with this java assignment: Ken's office hours are getting really full, and a long line is forming outside his office each time. The
students decide that they are too smart to simply line up, and decide on implementing a system. The
system is a queue, but with some weird exceptions. When a student joins the back of the line, if they
are younger or if their grade is lower than the person in front of them they can move up 1 spot, but only
1 spot.
Input
If a student is joining the line, the input format is the student's first name then a space then their age,
then a space, then their grade. When Ken helps the next student in line, removing them from the
queue, the input is next. When the input is done, the input is end.
Output
The output will be the order of the students currently in line. If the queue is empty, output the
word empty.
Example
Dale 2398
Christian 17100
Zane 6587
Esther 2186
next
Ellis 3299
Ashley 2295
end
Example Output
Zane 6587
Esther 2186
Dale 2398
Ashley 2295
Ellis 3299
 please help with this java assignment: Ken's office hours are getting

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!