Question: Hi, i'm trying to complete my homework assignment (Instructions are shown below), but for some reason my insertMusicalChairs method is not outputting correctly, I think

Hi, i'm trying to complete my homework assignment (Instructions are shown below), but for some reason my insertMusicalChairs method is not outputting correctly, I think that the error is somehow coming from the seatStudents method but I am unsure. seatStudents is outputting correctly though. I've attached below the instructions for both methods, my solutions, and the output I keep getting for insertMusicalChairs (the correct output is on the instructions). Can you please help me fix my mistake?

Hi, i'm trying to complete my homework assignment (Instructions are shown below),but for some reason my insertMusicalChairs method is not outputting correctly, Ithink that the error is somehow coming from the seatStudents method butI am unsure. seatStudents is outputting correctly though. I've attached below theinstructions for both methods, my solutions, and the output I keep gettingfor insertMusicalChairs (the correct output is on the instructions). Can you please

3. seatStudents This method simulates students taking their seats in the Kindergarten classroom. Assume that the students are currently in studentslnLine and that there are enough available seats to seat all students in the line. - This method will populate the 2D array studentsSitting. - Students will be seated starting at the first row, first seat (studentsSitting[0][0] if a seat is present at that location). Once the first row is filled, continues into the next row. - It uses the seatingLocations array to determine if a seat exists at a location. - A student can sit at seat studentsSitting[i][j] only if seatingLocations[i][j] is true (seat exists). - Then seat the first student in studentsInLine and moves on to the second, third and so on. NOTES - A student is only in one place (musical chairs, seating chairs, or in line) at a time. At the end of this method studentsinLine is empty. - This method depends on enterClassroom and setupSeats. Test those individually on the driver prior to testing this method. 4. insertMusicalChairs This method represents students preparing to start musical chairs! Assume that the students are in studentsSitting. - Imagine this as a circle of chairs. - This method will take students from the studentsSitting array and add them to the musicalChairs circular linked list. - Students are to be inserted at the end of the linked list by traversing row-wise, then column-wise in the studentsSitting array. - REMEMBER: the pointer to a circular linked list points to the LAST item in the list, and that item points to the front. NOTES - At the end of this method studentsinLine and studentsSitting have no students. - This method depends on the previous methods from parts 1,2 , and 3 . Test those before testing insertMusicalChairs. This is the expected output using students1.in and seating1.in: Node curr = studentsInLine; hile (curr != null) \{ Student student = curr.getStudent (); int r=1; int c=1; for (int i=0;i

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!