Skip to content

Instantly share code, notes, and snippets.

@ayoolaao

ayoolaao/Employee.cs

Last active Nov 28, 2017
Embed
What would you like to do?
C# quick question
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
You can’t perform that action at this time.