Question: Java please PART C: Now we will add functionality that allows students to register for courses . Add an instance variable to the Student class

Java please

Java please PART C: Now we will add functionality that allows students

to register for courses . Add an instance variable to the Student

PART C: Now we will add functionality that allows students to register for courses . Add an instance variable to the Student class called courses which should maintain an ArrayList of courses that the student has registered in. Create a correspondng get method and initialze it to an empty list withn your constructors Create methods in the Student class called addCourse(Course c) and removeCourse(Course c) that add and remove courses from the Student's list of registered courses . Similarly, add an instance variable to the Course class called students which should maintain an ArrayList of students that are registered in the course. Create a correspondng get method and initialze it to an empty list withn your constructors Create methods in the Course class called addStudent(Student s) and removeStudent(Student s) that add and remove courses from the Student's list of registered courses Test vour code before continuing using the program below: public class studentCourseTestProgram2 I public static void main(String args[]) Student s1 - new Student ("Jackie Chen", 100123456, 2015) Student s2 new student ("Bruce Willis", 100234567, 2017); Student s3 = new Student ("Keanu Reeves", 100345678, 2017); Course c1 = new Course ("BIOL", 10100, "Introductory Biology I")

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!