public string Name {get; set;}
public int Age {get; set;}
public Student(string _Name, int _Age, double _GPA)
public double ShowGPA(string strType)
if (strType == "adjusted") val = GPA * 1.15;
return (val > 4.0)? 4.0 : val;
int sum = Name.Length + Age;
public static void Function(int i, ref double d)
Console.WriteLine("Entering CallFunction: i = {0}, d = {1}", i, d);
Console.WriteLine("Exiting CallFunction: i = {0}, d = {1}", i, d);
public static void Main()
Student eight = new Student(strName, iAge, dGPA);
Console.WriteLine(eight.ShowGPA("regular"));
Console.WriteLine(eight.ShowGPA("adjusted"));
Console.WriteLine(eight.LuckyDraw());
Console.WriteLine("=================");
Console.WriteLine("Age:{0}, GPA:{1}", iAge, dGPA);
Function(iAge, ref dGPA);
Console.WriteLine("Age:{0}, GPA:{1}", iAge, dGPA);