hi there i have some questions regarding declaration of methods in a class. I've started a little but ain't sure if i'm on the right track or not. Also i'm not sure what goes into the methods or how to declare. Anyone can point me in the right direction ? Thanks alot!
3. The School
class represents the Module Registration System in a school. It has three properties:
the schoolName (String), and two collection lists, namely moduleList(ArrayList of
modules) and studentList( ArrayList of students.
The class has the following methods:
䀁ؠaddStudent – This method accepts a Student object and adds it to the
studentList.
䀁ؠaddModule – This method accepts a Module object and adds it to the
moduleList collection.
䀁ؠremoveStudent - This method accepts a int representing the studentID and
searches for the student within the studentList collection. It returns true when
the student is found, and removed from the studentList. Otherwise it returns
false.
䀁ؠremoveModule - This method accepts a int representing the moduleID and
searches for the module within the moduleList collection. It returns true when
the module is found, and removed from the moduleList. Otherwise it returns
false.
䀁ؠsearchStudent – This method accepts an int representing the studentID and
searches for the student within the collection of students. It returns the student
if found, otherwise it returns a null value.
䀁ؠsearchModule – This method accepts an int representing the moduleID and
searches for the module within the collection of modules. It returns the module
if found, otherwise it returns a null value.
䀁ؠlistModules – This method goes through the collection of the modules and
displays all the information of each module in the moduleList.
䀁ؠlistStudents – This method goes through the collection of the students and
displays all the information of each student in the studentList.
䀁ؠclassFull - accepts a moduleID (int) and checks if the classLimit for the
module has been reached.
䀁ؠisOfferedInSem - accepts a moduleID (int) and a sem (int). It checks if the
module is offered in the semester sem.
䀁ؠregisterModule – This method accepts a studentID (int), a moduleID (int) and
a semester (int). Returns true when the module is added to the module list in
the Student object. Otherwise it returns false.
䀁ؠListModulesTaken – This method accepts a studentID (int) and display a list
of modules taken by the student in the format shown below.
005 Tan Ah Teck
101 Programming Fundamentals
202 Intermediate Programming
What i have done so far is