Question: 2. setupseats This method creates the classroom seats. Imagine that someone is putting down seats on a rectangular or square room. - We will use


2. setupseats This method creates the classroom seats. Imagine that someone is putting down seats on a rectangular or square room. - We will use a 2D array to simulate a room where each cell of the array can have a seat or not. - The instance variable seatingLocations is the 2D boolean array that shows which seats exist for students to seat at. - The instance variable studentsSitting is the 2D array that contains the students when they are seating. To complete complete this method do: 1. Read the input file to create the seating arrangement for 2D boolean array seatingLocations 2. Initialize the 2D Student array studentsSitting to be of the same size. The input file format is as follows: - The first line contains an integer representing the number of rows in the classroom, say r - The second line contains an integer representing the number of columns in the classroom, say c - Number of r lines, each containing c true or false values (true denotes a seat exists, false denotes that there is no seat at that position in the classroom) Use the Stdln library to read from a file: - StdIn.setFile(filename) opens a file to be read - StdIn.readint() reads the next integer value from the opened file (weather the value is in the current line or in the next line) - StdIn.readBoolean() read the next boolean value from the opened file (weather the value is in the current line or in the next line) This method DOES NOT seat students on the seats. This is the expected output for students1.in and seating1.in: This method DOES NOT seat students on the seats. This is the expected output for students1.in and seating1.in: Enter a seating availability input file seating1. in Students in Line: M. Brow N. Dyer P. Ferg D. Harb M. Hawk C. Heat J. Keer G. Mata C. McLa M. Modi D. Mont P. Reis W. Ryde N. Schn S. Sink F. Wolf
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
