subject
Computers and Technology, 06.08.2021 20:50 maligv

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. Feel free to reuse any of the code from the modules to complete the requirements. Note: I do not award or deduct points for style, but to make grading easier on me, please to do use comments to explain your code. I find explanatory comments distracting. If you need comments for your own use, save a copy for yourself, then remove the comments before uploading your work.
User Interface Logic
Main Class
This class will be responsible for any and all user interaction. This means that if you want to get input from the user, or display output to the user, all of that code must be in the main class. This keeps all user interaction in one class, separate from the business logic of the program. By keeping your user interface logic in a separate class, it will make it SO much easier to reuse your business logic classes in other types of applications, like GUI applications, later on.
Create a main method in its own class. The main method should create an object of the seatingChart class (defined below) and call its methods for testing purposes.
Business Logic
Student Class
private member data
String first
String last
int student id
public methods:
public Student(String first, String last, int id) : A constructor with parameters to set the instance variables.
public String toString(): This method should return a string that contains all of the private member data as a single string. Be kind to your client and make it readable.
An accessor (getter) method for each instance variable.
SeatingChart Class
Create a separate class called seatingChart that has an array of student objects as a private instance member of the seattingChart class. The array of student objects should be size 20. The seatingChart class must also have these methods:
public void addStudent(String first, String last, int id, int seatnum) -- This method should add one student to the specified seat number on the seating chart. Position 0 of the array represents the seat closest to the teacher's desk. The array index will represent each seat number for the seating assignments.
public int findStudent(String first) -- This method should search the seating chart and return the seat number of a specified student first name. Remember, The array index will represent each seat number for the seating assignments, so this method should return the array index number as the seat number. This method should use the binary search algorithm described in the modules.
public void swapStudent(String first, int targetSeat) -- This method should find the students name in the array by calling the findStudent method, and then move the student object from his or her original seat to the target seat as a swap. No students should be lost; if the target seat is not empty, the students will trade seating assignments.
public String toString() -- This method will return a string that holds the entire seating chart, but this string will only include each seat number (empty or filled) and only the first name of the student in that seat. You can choose how the information is formatted in the string, but be kind to your client and make it readable.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 14:00
How are stop motion special effects in animated films created
Answers: 1
question
Computers and Technology, 23.06.2019 16:00
An english teacher would like to divide 8 boys and 10 girls into groups, each with the same combination of boys and girls and nobody left out. what is the greatest number of groups that can be formed?
Answers: 2
question
Computers and Technology, 24.06.2019 03:00
Will do anything for brainlest so can you guys me out i will try my best to you out
Answers: 1
question
Computers and Technology, 24.06.2019 10:30
You're programming an infinite loop. what must you include in your code to prevent crashes? in roblox
Answers: 2
You know the right answer?
For this project, you will create a class for an elementary school that will allow a teacher to ente...
Questions
question
Mathematics, 17.09.2020 15:01
question
Biology, 17.09.2020 15:01
question
History, 17.09.2020 15:01
question
Mathematics, 17.09.2020 15:01
question
Mathematics, 17.09.2020 15:01
question
Mathematics, 17.09.2020 15:01
question
Mathematics, 17.09.2020 15:01
question
Mathematics, 17.09.2020 15:01
question
Mathematics, 17.09.2020 15:01
question
Mathematics, 17.09.2020 15:01
question
Mathematics, 17.09.2020 15:01
question
Mathematics, 17.09.2020 15:01
question
English, 17.09.2020 15:01
question
Mathematics, 17.09.2020 15:01
question
English, 17.09.2020 15:01
question
Mathematics, 17.09.2020 15:01
question
Mathematics, 17.09.2020 15:01
question
Mathematics, 17.09.2020 15:01
question
Mathematics, 17.09.2020 15:01
Questions on the website: 13722367