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();
}
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.