Commit f148fbaf authored by 9831133's avatar 9831133

Update Student.java

parent a4ba78a6
public class Student {
private String firstName;
// the student’s last name
// the student’s first name
private String lastName;
// the student ID
// the student last name
private String id;
//the grade
//the id
private int grade;
// the grade
public String getFirstName () {
return firstName;
}
......@@ -16,24 +17,32 @@ public class Student {
firstName = fName;
}
/**
* Print the student’s last name and ID number to the
output terminal.
*/
* Print the student's last name and ID number to the output terminal.
*/
public void print() {
System.out.println(lastName + ", student ID: "
+ id + ", grade: " + grade);
}
// Prints the student's information
public void setGrade (int grade2){
grade=grade2;
}
// This function sets the grade
public int getGrade(){
return grade;
}
// This function gets tne grade
public Student(String fName, String lname, String sID){
firstName = fName;
lastName = lname;
id = sID;
grade = 0;
}
/**
* @param fName first name of student
* @param lname last name of student
* @param sID student ID
*/
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment