[Solved]Java Help Someone Please Help Java Program T Understand Many Functions Course Cname String Q37066305
Java HELP: Can someone please help withthis Java program? I can’t understand many functions.
Course
– c_name: String
– c_bldg: String
– c_bldg_room: String
– c_capacity: int
– c_ID: int
– enrolledStudents: ArrayList
– courseTeacher: Teacher
– nextCourseID: int (static)+ Course(name: String, bldg:String, room: String, capacity: int)
+ enrollStudent(new_Student: Student): void
+ deleteStudent(studentID: int): boolean
+ assignTeacher(newTeacher: Teacher): void
+ setC_Bldg_Room(room: String):void
+ setC_Bldg(room: String): void
+ setCapacity(newCap: int): void
+ setCourseName(name: String): void
+ toString(): String
+ getList(): String
Course Requirements:
‐ The datafield “enrolledStudents” has a type of ArrayList. Thismeans that an ArrayList reference variable is created, and it is oftype Student class which means that each Course instance objectwill have a reference variable pointing towards an ArrayList whichcontains references to Student instance objects. That’s how you aregoing to “enroll” students in your Course. Point tonote: the declaration of the ArrayList variable is the firststep, you should then create a new instance of the Array List topin-point that reference at.
‐ While enrolling a student, you must make sure the size of theenrolledStudents ArrayList is less than or equal to the course’scapacity.
‐ Deleting a student is done by comparing studentID’s. The studentwill be removed only if the parameter matches.
‐ The toString() method prints out a description of the course.This method should work regardless of whether there has been anInstructor assigned to the course. Notice thatthis class has a “courseTeacher” data field, of type Teacher. Thereference variables point at null if no instance object’s addresshas been assigned to them.
– The getList() method will print the full roster ofstudents that are enrolled in this course. If there are no studentsin the course, it will prompt the user accordingly and not attemptto print any.
P. S. [Array list must be pre-populated]
Other UMLs are:
Student
– f_name: String
– l_name: String
– stu_year: String
– stu_major: String
– GPA: double
– stu_email: String
– studentID: int
– nextStudentID: int (static)
Student(name: String, year: int, major: String, GPA:double, email: String)
+ getName(): String
+ getStudentID(): int
+ setGPA(GPA: double): void
+ getGPA(): double
+ setStudentEmail(email: String): void
+ getStu_Major(): String
+ setStu_Major(major: String): void
+ getStu_Year(): String
+ setStu_Year(year: int) :void
Teacher
– name: String
– prefix: String
– office: String
– dept: String
– t_email: String
– teacherID: int
– nextTeacherID: int (static)+ Teacher(name: String, prefix:String, office_loc: String, t_dept: String, email: String)
+ setName(name: String): void
+ setPrefix(prefix: String): void
+ setDepartment(dept: String): void
+ setEmail(email: String): void
+ setOfficeLocation(office: String)
+ getTitle(): String
+ toString(): String
Expert Answer
Answer to Java HELP: Can someone please help with this Java program? I can’t understand many functions. Course – c_name: String – … . . .
OR

