/** * The Student class represents a student in a student administration system. * It holds the student details relevant in our context. * * @author Michael Kölling and David Barnes * @version 2011.07.31 */ public class Student extends Person { // the amount of credits for study taken so far private int credits; private Person person; /** * Create a new student with a given name and ID number. * @param fullName name of student * @param personID ID of student */ public Student(String fullName, String personID) { super(fullName, personID); credits = 0; } /** * Add some credit points to the student's accumulated credits. * @param additionalPoints number of points to be given to student */ public void addCredits(int additionalPoints) { credits += additionalPoints; } /** * Remove credit poinst from this student's credits. * @param removePoints number of points to be removed */ public void removeCredits(int removePoints) { credits -= removePoints; } /** * Return the number of credit points this student has accumulated. * @return returns amount of credits student has */ public int getCredits() { return credits; } }