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 studentint
getGrade()
a normal getter for gradejava.lang.String
getId()
a normal getter which returns the IDjava.lang.String
getLastName()
getLastName method is used to return the students last namevoid
print()
print the students last name and ID number to the output terminalvoid
setFirstName(java.lang.String fName)
void
setGrade(int score)
getter and setter for both id and gradevoid
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
-
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 studentlname
- last name iof studentsID
- 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
-