Example #1
0
        //Checks if this student record is equal to another student record.
        //Return true if each quiz, midterm, and final have the same score; false otherwise.
        public override bool Equals(object obj)
        {
            StudentRecord other = (StudentRecord)obj;

            if (null == other)
            {
                return(false);
            }

            for (int i = 0; i < quiz.Length; i++)
            {
                if (quiz[i] != other.quiz[i])
                {
                    return(false);
                }
            }

            if (midterm != other.midterm || final != other.final)
            {
                return(false);
            }
            return(true);
        }
Example #2
0
        public override bool Equals(object obj)
        {
            StudentRecord newrec = (StudentRecord)obj;

            return(GetOverallGrade() == newrec.GetOverallGrade());
        }