Created
July 24, 2020 14:32
-
-
Save nanwang2016/95421cf2f73f0b12c781d205397ecf4f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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