Last active
November 28, 2017 21:42
-
-
Save ayoolaao/71b3e530dc236f6d69c28b6f775c687c to your computer and use it in GitHub Desktop.
C# quick question
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 Mod2_Lab1 | |
{ | |
public abstract class Employee | |
{ | |
// Class Vars | |
private string employeeName; | |
private double employeebaseSalary; | |
private int employeeId; | |
private static int employeeCount = 1; | |
// Props | |
public string Name | |
{ | |
get | |
{ | |
return employeeName; | |
} | |
set | |
{ | |
employeeName = value; | |
} | |
} | |
public double BaseSalary | |
{ | |
get | |
{ | |
return employeebaseSalary; | |
} | |
set | |
{ | |
employeebaseSalary = value; | |
} | |
} | |
public int ID | |
{ | |
get | |
{ | |
return employeeId; | |
} | |
set | |
{ | |
employeeId = value; | |
} | |
} | |
// methods | |
public double getBaseSalary() | |
{ | |
return this.BaseSalary; | |
} | |
public string getName() | |
{ | |
return this.Name; | |
} | |
public getEmployeeID() | |
{ | |
return this.ID; | |
} | |
public string toString() | |
{ | |
return this.ID + " " + this.Name; | |
} | |
public virtual string employeeStatus() | |
{ | |
return toString() + " is in the company's system"; | |
} | |
//Constructors | |
protected Employee(string name, double baseSalary) | |
{ | |
this.Name = name; | |
this.BaseSalary = baseSalary; | |
this.ID = employeeCount++; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment