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") return GPA *1.15;
return((val >4.0)? 4.0: val);
if ((Name.Length + Age)%4 == 0)
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 stud = new Student();
Console.WriteLine(stud.ShowGPA("regular"));
Console.WriteLine(stud.ShowGPA("adjusted"));
Console.WriteLine(stud.LuckyDraw());
Console.WriteLine("=================");
Console.WriteLine("Age:{0}, GPA:{1}", iAge, dGPA);
Function(iAge, ref dGPA);
Console.WriteLine("Age:{0}, GPA:{1}", iAge, dGPA);