Commit f148fbaf authored by 9831133's avatar 9831133

Update Student.java

parent a4ba78a6
public class Student { public class Student {
private String firstName; private String firstName;
// the student’s last name // the student’s first name
private String lastName; private String lastName;
// the student ID // the student last name
private String id; private String id;
//the grade //the id
private int grade; private int grade;
// the grade
public String getFirstName () { public String getFirstName () {
return firstName; return firstName;
} }
...@@ -16,24 +17,32 @@ public class Student { ...@@ -16,24 +17,32 @@ public class Student {
firstName = fName; firstName = fName;
} }
/** /**
* Print the student’s last name and ID number to the * Print the student's last name and ID number to the output terminal.
output terminal. */
*/
public void print() { public void print() {
System.out.println(lastName + ", student ID: " System.out.println(lastName + ", student ID: "
+ id + ", grade: " + grade); + id + ", grade: " + grade);
} }
// Prints the student's information
public void setGrade (int grade2){ public void setGrade (int grade2){
grade=grade2; grade=grade2;
} }
// This function sets the grade
public int getGrade(){ public int getGrade(){
return grade; return grade;
} }
// This function gets tne grade
public Student(String fName, String lname, String sID){ public Student(String fName, String lname, String sID){
firstName = fName; firstName = fName;
lastName = lname; lastName = lname;
id = sID; id = sID;
grade = 0; 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