private double _yearlysalary;
public double YearlySalary
public double CalculateSalary(string strType)
dSalary = YearlySalary/12;
else if (strType == "quarter")
dSalary = YearlySalary/4;
else if (strType == "year")
public string GetFirstThreeLetter(string strPractice)
string strFirstThreeLetter = strPractice.Substring(0,3);
return strFirstThreeLetter;
public static void Main()
Employee Employee1 = new Employee();
Employee1.YearlySalary = 75000;
Console.WriteLine(Employee1.GetFirstThreeLetter("John"));
Console.WriteLine(Employee1.CalculateSalary("month"));
Console.WriteLine(Employee1.CalculateSalary("quarter"));
Console.WriteLine(Employee1.CalculateSalary("year"));