Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Part 1 ( 2 0 points ) Add the Employee class to the project as follows: ( a ) Create 3 instance variables and 3
Part points
Add the Employee class to the project as follows:
a Create instance variables and corresponding properties as follows. Each property will have
nothing more than simple get set accessors:
Instance variable name string and public property Name
Instance variable department string and public property Department
Instance variable salary decimal and public property Salary
b Create constructors
A default constructor that just has as a method body.
public Emploveestring name, string department, decimal salary that initializes
the properties.
c Create a method that returns a formatted string by inserting a tab character between each field.
The form below shows the output created by this method. Use the following method header
public virtual string getDisplayText format salary as currency!
d Create an abstract method that returns bonus as follows:
public abstract decimal getBonus;
Part points
Using Employee as the base class, add a class ManagementEmp class that inherits from the Employee
class.
a It should use the base class Employee class constructors and other methods as much as
possible.
b Add a variable as follows:
Instance variable years decimal and public property Years
Years refers to the number of years of service for this employee
c It should have a constructor that takes four input parameters: name, department,
salary, years
d Add a getPowerValue method to compute a measure of the power and value of the
management employee. Use the following method header:
public decimal getPowervalue
This method should return a number that is equal to years salary
e Write the getBonus method: Bonus must be computed as of the salary.
f Override the getDisplayText method to include the years. Must use the base class method.Part points
Using Employee as the base class, add a class ClericalEmp class that inherits from the Employee class.
a It should use the base class Employee class constructors and other methods as much as
possible.
b Add a variable as follows:
Instance variable sickleave int and public property Sickleave
Sickleave refers to the amount of sick leave this employee has
c It should have a constructor that takes four input parameters: name, department,
salary, sickleave
d Add a getTotalSickLeaveValue method to compute the total value of the sick leave. Use the
following method header:
public decimal getTotalSickLeaveValue
This method should return a number that is equal to salary sickleave ;
e Write the getBonus method: Bonus must be computed as of the salary.
f Override the getDisplayText method to include the sickleave. Must use the base class method.
Part points
Create the following form that uses the Employee class as follows
The form will have an instance variable "employees" that is a List of Employees. The user
interface should be as follows:
Your code needs to add a management employee to the list when the user clicks "Add
Management Employee" button.
Your code needs to add a clerical employee to the list when the user clicks "Add Clerical
Employee" button.
When the user clicks the button, "Show Employee Information". Your code should display the
following in the list box:
Show each employee's details in the list box using the get display text method
The total salaries of all employees in the list box formatted as currency
The total of Power Values of all Management Employees in the list box.
The average power value per management employee.
The total of Sick leave Values of all Clerical Employees in the list box formatted as
currency
The average sick leave per clerical employee.
The average salary per management employee
The average salary per clerical employee
The average salary per employee
Add a label to the form that shows the total number of employees. Update the label with the
total number of employees in the employees list.
Use validation for input values and include try catch blocks.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started