Skip to content

Instantly share code, notes, and snippets.

@ayoolaao
Last active November 28, 2017 21:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ayoolaao/71b3e530dc236f6d69c28b6f775c687c to your computer and use it in GitHub Desktop.
Save ayoolaao/71b3e530dc236f6d69c28b6f775c687c to your computer and use it in GitHub Desktop.
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