Answered step by step
Verified Expert Solution
Link Copied!

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)image text in transcribed

image text in transcribedimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Murach's SQL Server 2012 For Developers

Authors: Bryan Syverson, Joel Murach, Mike Murach

1st Edition

1890774693, 9781890774691

More Books

Students also viewed these Databases questions

Question

LO3 Name the seven categories of HR functions.

Answered: 1 week ago