Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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)
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 listStep 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