Polymorphism - exercise
<p>Alright, so this is the exercise: </p>

<blockquote>
  <p>Define a class named student,
  containing three grades of students.
  The class will have a function that
  calculates the grades average. Now,
  define a class named student1 which
  will be derived from student and will
  add a function to calculate the sum of
  the grades.In the Main program, define
  a student variable and object of type
  student1. Perform placement of the
  object to variable and run the
  function of student1.</p>
</blockquote>

<p>Note: This is not homework, I'm learning this my own.
This is the code: </p>

<pre><code>class Student
{
    protected int grade1, grade2, grade3;
    public Student(int grade1, int grade2, int grade3)
    {
        this.grade1 = grade1;
        this.grade2 = grade2;
        this.grade3 = grade3;
    }
    public double Average()
    {
        return (grade1 + grade2 + grade3) / 3;
    }
}
class Student1 : Student
{
    public Student1(int grade1, int grade2, int grade3)
        : base(grade1, grade2, grade3)
    {
    }
    public double Sum()
    {
        return grade1 + grade2 + grade3;
    }
}
class Program
{
    static void Main(string[] args)
    {
    }
}
</code></pre>

<p>I don't really know what to do in the main class, how do I perform this placement and also, I wanted to know what's the benefit of doing it, let me know if I have mistakes so far, thanks alot.</p>
