Question: Implement a University System with Course Registration Problem Statement: Create a class Student that encapsulates the following attributes: studentID ( String ) name ( String

Implement a University System with Course Registration
Problem Statement:
Create a class Student that encapsulates the following attributes:
studentID (String)
name (String)
registeredCourses (an array of Strings with a maximum of 5 courses)
Implement the following:
A constructor to initialize studentID, name, and an empty array for
registeredCourses.
Getter and setter methods for studentID and name.
A method registerCourse(String course) that adds a course to the
registeredCourses array, ensuring that no more than 5 courses can be registered. Print
a message if the limit is exceeded.
A method dropCourse(String course) that removes a course from the array.
A method printCourses() that prints all registered courses

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 Programming Questions!