Your task for this project is to develop part of an object-oriented program for a human resources system for making payments for employees. Your system must handle two types of payments:
• Fixed payments – where the amount paid to an employee is based upon a fixed amount, with no variation due to performance;
• Prorata payments – where the amount paid to an employee depends upon performance factors, e.g., hours worked or value of goods sold.
Your system must also handle three ways of paying employees:
• Salary – an employee who is paid based on an annual rate (fixed);
• Wage – an employee who is paid hourly (prorata);
• Sales commission – an employee who receives a base salary plus receives an additional bonus based on percentage of sales (fixed and prorata).
Your program must include the following:
• You must apply both inheritance and interfaces in your solution – this will require defining more than one class and interface;
• You must demonstrate accessing your data polymorphically in several ways, including the use of both ToString() method and your own polymorphic methods;
• You must use the provided Employee class and (partially complete) Main method;
Note that the actual classes, inheritance hierarchy, and interfaces that you use in your program are up to you. Marks will be awarded for the correct application of object-oriented concepts learned in the unit to date, including:
• Class definition – instance variables, properties, and, methods;
• Correct application of abstraction and encapsulation;
• Correct application of inheritance and interfaces;
• Correct demonstration of polymorphic behavior;
Hint 1: Before starting, consider carefully how your program should be structured in terms of inheritance and interfaces. Taking the time to decide on how to represent these concepts in your application will save you a great deal of time later.
Hint 2: If you are receiving error messages about inconsistent accessibility, make sure you use the public accessibility level on each of your classes.
Note: Your output does not need to match the example below, however your output must similarly break down the information (the second and third sets of output below represent the remuneration data being accessed polymorphically in different ways).
Workers:
Benita's remuneration: $60,000.00 salary
Pete's remuneration: $35,000.00 base salary plus 5.00% of total sales
Travis's remuneration: $25.00 hourly wage wage
Fixed payment remunerations:
Benita receives $60,000.00 salary
Pete receives $35,000.00 base salary
Prorata payment remunerations:
Pete receives 5.00% of total sales
Travis receives $25.00 hourly wage
Note: The following class must be used in your program, unchanged.
using System;
namespace Project_2
{
public class Employee
{
private string _Name;
public string Name
{
get { return _Name; }
}
private Remuneration _Remuneration;
public Remuneration Remuneration
{
get { return _Remuneration; }
}
public Employee(string name, Remuneration remuneration)
{
_Name = name;
_Remuneration = remuneration;
}
public override string ToString()
{
return [login to view URL]("{0}", _Name);
}
}
}
Program Class / Main Method
Note: The code provided in the Main method below must be used in your program, unchanged. You may write your own code in the Main method at the indicated location.
using System;
namespace Project_2
{
public class Program
{
static void Main(string[] args)
{
Employee [] workers = new Employee[] {
new Employee("Benita", new Salary(60000.00M)),
new Employee("Pete", new SalesCommission(35000.00M, 0.05M)), new Employee("Travis", new Wage(25.00M))
};
[login to view URL]("Workers:");
foreach (Employee emp in workers)
[login to view URL]("\t{0}'s remuneration: {1}", emp, [login to view URL]); [login to view URL]();
// YOUR CODE GOES HERE...
}
}
}