Answered step by step
Verified Expert Solution
Question
1 Approved Answer
For this project, you will create a class for an elementary school that will allow a teacher to enter each student's seating assignment. Occasionally, the
For this project, you will create a class for an elementary school that will allow a teacher to enter each student's seating assignment. Occasionally, the teacher may need to switch the seating assignment of a student. If there is a seat available, the student is moved. If all of the seats are already assigned, the teacher will have two students trade seats.
Minimum Requirements:
- Create a class called student that holds information about one student including the student's name. The class must have methods to set each instance variable and methods to get each instance variable.
- Create a class called seatingChart and create a multidimensional array of student objects as an instance member. The array of student objects should be able to handle a class of size 20.
- Include an addStudent function that has parameters for a student name, target seat row and column to add one student to the seating chart array in the multidimensional array position [row, column] provided by the parameters. Position [0,0] represents the seat closest to the teacher's desk. Do not store a seat number in the student class; the array index will represent each seat for the seating assignments.
- Include a swapStudents function that has parameters for a student name, target seat row and column. This function should find a student's name in the multidimensional array and swap the student from his or her original seat to the target seat in the multidimensional array position [row, column] provided by the parameters. The result will be that those students trade seating assignments.
Step 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