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, 22.06.2019 22:20
Pp 4.1 design and implement a class called sphere that contains instance data that represents the sphere’s diameter. define the sphere constructor to accept and initialize the diameter and include getter and setter methods for the diameter. include methods that calculate and return the volume and surface area of the sphere (see pp 3.5 for the formulas). include a tostring method that returns a one-line description of the sphere. create a driver class called multisphere, whose main method instantiates and updates several sphere objects.
Answers: 1
question
Computers and Technology, 22.06.2019 22:30
Who needs to approve a change before it is initiated? (select two.) -change board -client or end user -ceo -personnel manager -project manager
Answers: 1
question
Computers and Technology, 22.06.2019 22:30
The qwerty keyboard is the most common layout of keys on a keyboard
Answers: 3
question
Computers and Technology, 23.06.2019 01:30
1. which of the following is a search engine? a) mozilla firefox b)internet explorer c)google d)safari 2. which of the following statements is true? a) all search engines will provide the same results when you enter the same query. b) all search engines use the same amount of advertisements. c) some search engines are also browsers. d) search engines often provide different results, even when you enter the same query.
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, 16.09.2020 01:01
question
Mathematics, 16.09.2020 01:01
question
Mathematics, 16.09.2020 01:01
question
Mathematics, 16.09.2020 01:01
question
Mathematics, 16.09.2020 01:01
question
English, 16.09.2020 01:01
question
Mathematics, 16.09.2020 01:01
question
Mathematics, 16.09.2020 01:01
question
Mathematics, 16.09.2020 01:01
question
English, 16.09.2020 01:01
question
Mathematics, 16.09.2020 01:01
question
Mathematics, 16.09.2020 01:01
question
Mathematics, 16.09.2020 01:01
question
Mathematics, 16.09.2020 01:01
question
English, 16.09.2020 01:01
question
Mathematics, 16.09.2020 01:01
question
Mathematics, 16.09.2020 01:01
question
Computers and Technology, 16.09.2020 01:01
question
Mathematics, 16.09.2020 01:01
question
Mathematics, 16.09.2020 01:01
Questions on the website: 13722363