Advertisement
Hako0

Untitled

Jan 18th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. /**
  2. * The Student class represents a student in a student administration system.
  3. * It holds the student details relevant in our context.
  4. *
  5. * @author Michael Kölling and David Barnes
  6. * @version 2016.02.29
  7. */
  8. public class Student
  9. {
  10. private int credits;
  11.  
  12. /**
  13. * Create a new student with a given name and ID number.
  14. */
  15. public Student(String fullName, String studentID)
  16. {
  17. super(fullName, personId);
  18. credits = 0;
  19. }
  20.  
  21. /**
  22. * Add some credit points to the student's accumulated credits.
  23. */
  24. public void addCredits(int additionalPoints)
  25. {
  26. credits += additionalPoints;
  27. }
  28.  
  29. /**
  30. * Return the number of credit points this student has accumulated.
  31. */
  32. public int getCredits()
  33. {
  34. return credits;
  35. }
  36.  
  37.  
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement