Archives from S:\ Drive
Good to keep around methinks
This commit is contained in:
1 parent
eadaf70b9e
commit
6dd63cc439
606 files changed
+50212
No files matched your search
@@ -0,0 +1,49 @@
|
||||
/*****************************************************************************
|
||||
* Project: 2 - Payroll *
|
||||
* Description: Impliment a payroll system using abstract classes *
|
||||
* Author: Amrit Panesar - 77260 *
|
||||
* License: Public Domain *
|
||||
* File description: Houses the main driver for the program. Instantiates an *
|
||||
* array of 10 Employees that demonstrates polymorphic behavior *
|
||||
* For further description please see ARCHITECTURE.txt *
|
||||
*****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Project2
|
||||
{
|
||||
public abstract class Employee
|
||||
{
|
||||
// empty constructor, don't do anything.
|
||||
public Employee() { }
|
||||
|
||||
// main constructor, each value as a parameter.
|
||||
public Employee(string fname, string lname, string ssn)
|
||||
{
|
||||
FirstName = fname; LastName = lname; SocialSecuityNumber = ssn;
|
||||
}
|
||||
|
||||
// we have the flexibility to pass in an entire new employee if necessary.
|
||||
public Employee(Employee empn)
|
||||
{
|
||||
FirstName = empn.FirstName; LastName = empn.LastName; SocialSecuityNumber = empn.SocialSecuityNumber;
|
||||
}
|
||||
|
||||
public string FirstName { get; set; }
|
||||
public string LastName { get; set; }
|
||||
public string SocialSecuityNumber { get; set; }
|
||||
|
||||
// abstract. must be implemented by all other inherited classes.
|
||||
public abstract decimal Earnings();
|
||||
|
||||
// override the tostring. this is the base tostring.
|
||||
public override string ToString()
|
||||
{
|
||||
// The standard employee: employee first name, last name, and social security number
|
||||
return String.Format("employee: {0} {1}\nssn: {2}", FirstName, LastName, SocialSecuityNumber);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user