Lab 02
Lab 02
Class of Student Chart contains data for all students. Department of studying students
at any one time are up to100 . Way to add a student, is by method addStudent only. At
the beginning of the course each student has not been added, the number of students
enrolled in the Department is 0. Think what would be the fields of this class, so that
you can know much information at any one time.
Constructors:
Creat the class chart according to the private
StudentChart() . .fields(variables)
StudentChart(StudentChart
sc) Copy Constructor
Methods:
Return
type Method name and parameters operation
Add student to the list- if there a space in the list add
boolean addStudent(Student student student and return true otherwise return false.
Delete student from the list. Do nothing if the student
does not exist in the list. There should not be any space
void deleteStudent(Student student) between students in the list after deletion.
int )(getNumOfStudents Returns the number of students in the list.
boolean isStudent(Student student) Examine if student exists in the list.
Student getStudent(int studentNum) .Returns students data for the students with studentNum
Returns the student average in the course with number
double getAverage(int course) course
Returns student average in all courses for all students.
double )(getAverage (You can use the Student class methods).
void )(printStudentChart Prints the students data for all students as follow:
Student number 1:
<Student String representation>
Student number 2:
<Student String representation>
…
Student number <n>:
<Student String representation>
If there are no students print:
No students!
Good Luck.