1. Make a windows application in Visual Studio and name it as A2FirstnameLastname.
2. Design and implement a Windows Form application that keeps track of the employees in a company and their earnings information. The application calculates an employee's wages and allow users to review employee information of any previously added employee.
NOTE: At no point should the application save any information to disk. All information is stored and managed in memory using a collection. The use of collections and the object-oriented design of the solution are an important part of the evaluation of your submission.
3. Design a form that looks something like the one below. Feel free to change the layout and colors: see image.
4. Ensure all names follow the naming conventions used in class.
5. Ensure the form is displayed centered on the screen.
6. Ensure the tab order of all controls is set correctly.
1. User selects a type of employee from the radio buttons.
2. On selecting "Commission Based" radio button, the labels Hours Worked and Hourly Wage should change to Gross Sales and Commission Rate, respectively. (See screenshots at the end of this document).
3. On selecting "Weekly Salary" radio button, the label Hours Worked should change to Weekly Salary, and Hourly Wage label and text box should hide.
4. Then, the user can enter the name of an employee, and the earning details.
5. Upon clicking the "Calculate" button, the application shall calculate and display the gross earnings, taxes and net earnings.
6. After doing the above calculations, add the employee names to the combo-box. The combo-box shall ONLY display the employee name and no other information.
7. The application shall keep track of the employees using the most appropriate generic collection.
8. Upon selecting an existing employee, display the wage information associated with it including earnings.
9. The "Clear" button should clear all the fields of the form with the exception of the Employee combo- box.
10. The "Close" button should close the form.
1. Create an enum to handle the "type of employee".
2. Create an abstract class Employee.
a. This class stores employee name and employee type.
b. An abstract readonly property GrossEarnings. This property is implemented in each derived class to calculate the earnings of each type of employee.
(readonly means property having only get accessor. This does not mean using the readonly keyword)
c. A readonly property Tax, that calculates and returns the 20% tax.
d. A readonly property NetEarnings that returns the net earnings after tax deductions.
e. In addition to these, you can also create virtual properties HoursWorked, HourlyWage, GrossSales, CommissionRate and WeeklySalary, and override them in the respective derived classes.
3. Inherit the class HourlyEmployee from Employee.
a. This class stores hours worked and hourly wage.
b. Implements the GrossEarnings property that returns the earnings of this employee, considering any overtime at the rate of 1.5.
4. Inherit the class CommissionEmployee from Employee.
a. This class stores the gross sales and commission rate.
b. Implements the GrossEarnings property that returns the earnings of this employee.
5. Inherit the class SalariedEmployee from Employee.
c. This class stores the weekly salary.
d. Implements the GrossEarnings property that returns the earnings of this employee.
6. On the "Calculate" button's click event, after figuring out which type of employee it is, call the GrossEarnings property polymorphically.
1. There should be no unhandled exceptions of any kind at run-time.
2. Display all errors resulting from the input validation using MessageBoxes. Validate the input as follows:
a. All fields are required (radio buttons, name, hours worked and hourly wage).
b. The name of the employee should be unique.
c. The hours worked has to be a positive real number and cannot exceed 80.
d. The hourly wage, gross sales, commission rate and weekly salary fields have to be a positive real number.
3. The error messages should be clear and understandable.
a. Something like, "Name field can not be left blank".
b. Not like Invalid input, or Input was not in a correct format.