Student
name: String
id: String
arrMarks []: int
nbm: int
+ Student(name: String, id:String, size: int)
+ addMark(mark: int): boolean
+ searchMark( mark: int): int
+ averageMarks(): double
+ maxMark(): int
+ display(): void
A class called Student is designed as shown in the following class diagram. It contains:
A private instance variable: name of the type String.
A private instance variable: id of the type String.
A private instance variable: arrMarks: an array of the type int containing the marks of the student.
A private instance variable: nbm of type int. It is a counter specifying the number of marks in the
array.
A constructor, which takes as arguments: name, id, and size of the array.
A public method addMark(mark: int) which receives mark as argument and returns true if the
mark is added successfully otherwise it returns false.
A public method searchMark(mark: int) which receives mark as argument, searches for it and
returns its position.
A public method averageMarks() which computes and returns the average of marks.
A public method maxMark() which computes and returns the maximum mark.
A public method display() which displays the details of the object student.
1. Write in Java the class Student.
2. Write in Java a Test Driver to test your Student class.