Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions