0% found this document useful (0 votes)
28 views2 pages

Lab 02

The document describes a StudentChart class that contains data for all students in a department. The class has methods to add, delete, and retrieve student data. It also describes a Lab01_Test class with a main method that demonstrates adding and removing students from the StudentChart.

Uploaded by

mo2419270
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views2 pages

Lab 02

The document describes a StudentChart class that contains data for all students in a department. The class has methods to add, delete, and retrieve student data. It also describes a Lab01_Test class with a main method that demonstrates adding and removing students from the StudentChart.

Uploaded by

mo2419270
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Student Chart

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!

Write a class named Lab01_Test with main method:

1. Add 4 students to student chart with their grades in their courses


2. Print the students in the student chart
3. Delete one student from the student chart
4. Print the student chart after deletion

Good Luck.

You might also like