Computers and Technology
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.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 16:20, mandy9386
Consider the following statements, then select one of the answers below: the signal() function shown below registers "sig_handler()" as the signal handler function for the sigkill signal, without the complexity of using when the sigkill signal is sent to a process running this code, by a user typing "kill -kill ", where the correct process id is used for to target the process, sig_handler() will be executed.
Answers: 1
image
Computers and Technology, 23.06.2019 16:30, azainababbas
20 points archie wants to use a reflector as he photographs a newlywed couple. what would he consider in his choice? a. shadow and sunny b. homemade and professional c. lamps and boards d. incident and reflected e. neutral density and enhancement
Answers: 3
image
Computers and Technology, 23.06.2019 17:30, Annlee23
When making changes to optimize part of a processor, it is often the case that speeding up one type of instruction comes at the cost of slowing down something else. for example, if we put in a complicated fast floating-point unit, that takes space, and something might have to be moved farther away from the middle to accommodate it, adding an extra cycle in delay to reach that unit. the basic amdahl's law equation does not take into account this trade-off. a. if the new fast floating-point unit speeds up floating-point operations by, on average, 2ă—, and floating-point operations take 20% of the original program's execution time, what is the overall speedup (ignoring the penalty to any other instructions)? b. now assume that speeding up the floating-point unit slowed down data cache accesses, resulting in a 1.5ă— slowdown (or 2/3 speedup). data cache accesses consume 10% of the execution time. what is the overall speedup now? c. after implementing the new floating-point operations, what percentage of execution time is spent on floating-point operations? what percentage is spent on data cache accesses?
Answers: 2
image
Computers and Technology, 23.06.2019 23:40, lexiecooley
4. what is the reason for including the following code snippet in the header file animal. h? #ifndef animal_h #define animal_h class animal { public: animal(); animal(double new_area_hunt); void birth(); void hunt(double new_area_hunt); void death(); double get_area_hunt() const; private: double area_hunt; }; #endif
Answers: 3
Do you know the correct answer?
For this project, you will create a class for an elementary school that will allow a teacher to ente...

Questions in other subjects:

Konu
Mathematics, 11.06.2021 02:10
Konu
Advanced Placement (AP), 11.06.2021 02:10