Class Student

java.lang.Object
Student

public class Student
extends java.lang.Object
  • Constructor Summary

    Constructors 
    Constructor Description
    Student​(java.lang.String fName, java.lang.String lname, java.lang.String sID)
    creat a new stdent nam and id number
  • Method Summary

    Modifier and Type Method Description
    java.lang.String getFirstName()
    get the first name of a student
    int getGrade()
    a normal getter for grade
    java.lang.String getId()
    a normal getter which returns the ID
    java.lang.String getLastName()
    getLastName method is used to return the students last name
    void print()
    print the students last name and ID number to the output terminal
    void setFirstName​(java.lang.String fName)  
    void setGrade​(int score)
    getter and setter for both id and grade
    void setId​(java.lang.String id)
    this method will reset the students ID according to its digit counts if the input has more or less than 7 digits the method will print an error

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Student

      public Student​(java.lang.String fName, java.lang.String lname, java.lang.String sID)
      creat a new stdent nam and id number
      Parameters:
      fName - first name of student
      lname - last name iof student
      sID - student ID
  • Method Details

    • getFirstName

      public java.lang.String getFirstName()
      get the first name of a student
      Returns:
      firstName field
    • setFirstName

      public void setFirstName​(java.lang.String fName)
      Parameters:
      fName - set firstname of a student
    • print

      public void print()
      print the students last name and ID number to the output terminal
    • setGrade

      public void setGrade​(int score)
      getter and setter for both id and grade
      Parameters:
      score - represents the grade of the student
    • getGrade

      public int getGrade()
      a normal getter for grade
      Returns:
      grade which is the students grade
    • setId

      public void setId​(java.lang.String id)
      this method will reset the students ID according to its digit counts if the input has more or less than 7 digits the method will print an error
      Parameters:
      id - is the new student ID
    • getId

      public java.lang.String getId()
      a normal getter which returns the ID
      Returns:
      id which is the students ID
    • getLastName

      public java.lang.String getLastName()
      getLastName method is used to return the students last name
      Returns:
      lastName which is the students last name and is used in the Lab class