Question: i need to figure the registerStudent method!(last image) Room.java Student.java New Building.java Course.java 1. import java.util.*; 3. public class course{ private int courseID; private String

i need to figure the registerStudent method!(last image)i need to figure the registerStudent method!(last image) Room.java Student.java New Building.java

Course.java 1. import java.util.*; 3. public class course{ private int courseID; privateString courseCode; private String courseName; private int CourseCapacity; private int numberStudents; private

Room.java Student.java New Building.java Course.java 1. import java.util.*; 3. public class course{ private int courseID; private String courseCode; private String courseName; private int CourseCapacity; private int numberStudents; private Room room; private Student[] students; private int waitListCount; Dovou public Course(int ID, String code, String name, Room room) { this.courseID = ID; this.courseCode = code; this.courseName = name; this.room = room; -courseID: int -courseCode: String -courseName: String -courseCapacity: int -numberStudents: int -room: Room -students: Student[] -waitListCount: int +Course (ID: int, code: String, name: String, room: Room) +getBuildingName(): String +getCampus (): String +getCourseID(): int +getCourseCode (): String +getNumber Students(): int +getStudents(): Student[] (Returns array of registered students) tisInCourseAlready (student: Student): boolean +isSpaceLeftInCourse (): boolean +registerStudent (student: Student): int +toString(): String +registerStudent (student: Student): int Registers (adds) a Student to the class if possible. If the student is already in the course, the student is not added. If number of students in class is greater than the capacity of the room/course, the student is not added and the wait list count for the course by 1 (student's number on wait list). Returns 0 if student is added to course, -1 if previously registered, or the number on the wait list if there was no space in the course and they were added to the wait list

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!