Skip to content

Instantly share code, notes, and snippets.

@nanwang2016
Created July 24, 2020 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nanwang2016/95421cf2f73f0b12c781d205397ecf4f to your computer and use it in GitHub Desktop.
Save nanwang2016/95421cf2f73f0b12c781d205397ecf4f to your computer and use it in GitHub Desktop.
using System;
namespace TestFile
{
class Program
{
static void Main(string[] args)
{
Student UniStudent = new Student();
Console.WriteLine("Student GPA is:" + UniStudent.ComputeGradeAverage());
Console.WriteLine(UniStudent.OverallAcademicPerformance());
}
}
public abstract class Person
{
public string firstName { set; get; }
public string lastName { set; get; }
public string emailAddress { set; get; }
//Abstract Class Method
public abstract float ComputeGradeAverage();
//Non-Abstract Class Method
public string OverallAcademicPerformance()
{
return "Good Academic Performance";
}
}
public class Student : Person
{
public override float ComputeGradeAverage()
{
return 4.0f;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment