/*
 * File: StudentRecord.java
 * Class stores student mark data,
 * checks if two records refer to the same student,
 * combine the contents of two records.
 */
 
public class StudentRecord {

   private String number;
   private String surname;
   private String givenName;
   private String assignments = "";
   private String midterm = "";
   private String exam = "";
   
   
   // constructor
   public StudentRecord(String sname, String gname, String snumber) {
   
      number = snumber;
      surname = sname;
      givenName = gname;
   }
   
   // Store an assignment mark.
   public void setAssignments(String mark) {
   
      assignments = mark;
   }
   
   // Store a midterm mark.
   public void setMidterm(String mark) {
   
      midterm = mark;
   }
   
   // Store an exam mark.
   public void setExam(String mark) {
   
      exam = mark;
   }
   
   // Decide whether a pair of records refer to the same student.
   public boolean sameStudent(StudentRecord otherStudent) {
   
      return true;
   }
   
   // Combine the fields for two student records.
   // Precondition: The two records must refer to the same student.
   public StudentRecord mergeRecords(StudentRecord otherStudent) {
   
      return new StudentRecord("","","");
   }
   
   // Combine fields in printable form.
   public String toString() {
   
      return number + " " + surname + " " + givenName + " " + assignments + " " + midterm + " " + exam;
   }
   
}

