Menu

[Solved]Java Someone Please Help Java Program Course Cname String Cbldg String Cbldgroom String Cc Q37046521

JAVA: Can someone please help with this Javaprogram?

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 thefirst step, you should then create a new instance of the Array Listto pin-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 of studentsthat are enrolled in this course. If there are no students in thecourse, it will prompt the user accordingly and not attempt toprint any.

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: Can someone please help with this Java program? Course – c_name: String – c_bldg: String – c_bldg_room: String – c… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *