Question: java He created this shape following the below logic: 1. Each student is identified by their age and name. 2. Each student links to potentially

 java He created this shape following the below logic: 1. Each

java

He created this shape following the below logic: 1. Each student is identified by their age and name. 2. Each student links to potentially one other younger student and to potentially one other older student 3. A drone is picturing the students from the sky and its oriented towards the front of the playground (i.e. the front of the playground appears as the top part of the picture). 4. The rest of this question is presented from the point of view of the drone's pictures looking from the sky. 5. The first student to arrive at the school's playground stands at the top (i.e. front of the playground) and looks forward (i.e. this student doesn't see the playground behind them). 6. Once a new student arrives, they are assigned a standing location based on the following: 1. If the new student is younger or of the same age then their position should be on the left side and one level behind the student at the top 2. If the student is strictly older then their position should be on the right side and one level behind the student at the top 3. In case the intended position is already occupied, the principal would find the correct position at a deeper level by applying the same logic at every level. 7. At the end of the process, every student knew that: 1. All the students who are younger or of the same age as that student are standing somewhere behind him to the left 2. All the students who are strictly older than that student are standing somewhere behind him to the right Using our software, the ptincipal's assistant logged the full process! For the school's upcoming presentation, we were asked to: 1. Add functionality that displays this shape on our console 2. The displayed shape should have each row printed in increasing order of age (i.e. at each level, the youngest should be at the leftmost position)

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!