Create a class called Volunteer that inherits from the Employee class in figure below. Note that Employee is an abstract class. Just like in java, an abstract class is a template that can NOT be used to create objects. Why? Because it has an abstract method Earnings() which has not been implemented. Derived class which extend this class MUST provide the Earning() calculation in the derived class. So you must implement the Earning method in your Volunteer class. In your Volunteer class, Earnings() should calculate a tax-break that the volunteer earns. The tax break is calculated as $0.75 per 3 hours volunteered.
Your class should contain a constructor that inherits from the Employee class and initializes the instance variables. The Volunteer class should add an instance variable for the name of the company name where the volunteer service occurred and also a variable for hours volunteered. Create properties for them also.
Create a second class that prompts the user for the information for two Volunteers, creates the 2 Volunteer objects, then displays each Volunteer.
public abstract class Employee
{
public string FirstName { get; private set; }
public string LastName { get; private set; }
public string SocialSecurityNumber { get; private set; }
public Employee(string first, string last, string ssn)
{
FirstName = first;
LastName = last;
SocialSecurityNumber = ssn;
}
public override string ToString()
{
return string.Format("{0} {1}nsocial security number: {2}", FirstName, LastName, SocialSecurityNumber);
}
public abstract decimal Earnings();
}