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 spot, but only
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
Christian
Zane
Esther
next
Ellis
Ashley
end
Example Output
Zane
Esther
Dale
Ashley
Ellis
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
