Answered step by step
Verified Expert Solution
Question
1 Approved Answer
write a code in java. This method simulates students taking their seats in the Kindergarten classroom. Assume that the students are currently in studentsinLine and
write a code in java.
This method simulates students taking their seats in the Kindergarten classroom. Assume that the students are currently in studentsinLine and that there 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][i] only if seatingLocations[i][i] 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 methodStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started