0% found this document useful (1 vote)
114 views

Lab3PartA Assignment

1. The document describes an assignment to design an object-oriented class hierarchy to represent employees in a payroll system. 2. A base Employee class is to be created with common data like name, SIN, and methods like ToString() and Bonus(). Derived classes like Hourly and Supervisor add additional fields for calculating pay. 3. The student must create two new employee classes that inherit from base classes and include unique fields and pay calculation logic. A Data class is also to provide sample employee objects.

Uploaded by

Umair Zahid
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
114 views

Lab3PartA Assignment

1. The document describes an assignment to design an object-oriented class hierarchy to represent employees in a payroll system. 2. A base Employee class is to be created with common data like name, SIN, and methods like ToString() and Bonus(). Derived classes like Hourly and Supervisor add additional fields for calculating pay. 3. The student must create two new employee classes that inherit from base classes and include unique fields and pay calculation logic. A Data class is also to provide sample employee objects.

Uploaded by

Umair Zahid
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

PROG1224 Object Oriented Software Development Vanscoy

Lab 3 Part A Assignment

Objectives:
1. Apply object oriented concepts to design an object oriented system.
2. Develop classes containing data and methods to represent business logic.
3. Facilitate polymorphism using inheritance and interfaces.
4. Test object code for accuracy and correctness.

Preamble:
In Lab 3 Part A you will develop a class hierarchy to represent the business logic of an employee payroll
system. You design a base Employee and two other classes based on information provided. You then
customize your solution by designing two unique employee types of your own creation.

The Employee classes will be used in Lab 3 Part B where you develop a UWP Payroll Application. The
application provides different views and features for searching and managing employees and to
calculate payroll.

Instructions:
1. Refer to the hierarchy shown below. You need 5 classes in total. Three are described and two
you must create. The two you create must be part of the same hierarchy and have the same
interface (key methods).
2. The base class includes the following data. You decide how to represent the data in the base
class. Assume the data is required (except email) and should be validated and encapsulated.
Create appropriate property methods for each field. Place validation assumptions as comments
with each property or field:

- Social Insurance Number (9 digits)


- First and Last name
- Hire date and Date of Birth
- Phone number and Address
- Email (Optional meaning it could be set to empty or null)

3. The base class ToString() returns the Employee’s full name and phone number formatted.
4. The base class Bonus() method returns a default of zero dollars. Each class has its own version
of a CalculatePay() method that returns the employees bi-weekly pay. The CalculatePay()
method is required in each class that inherits the base class Employee. The Bonus() method is
optional and may be changed in some of the derived classes.
5. The Hourly class includes the following data for calculating pay:
- Hours worked for the current period
- Hourly rate of pay
6. The Supervisor class includes the following data for calculating pay:
- Yearly Salary
PROG1224 Object Oriented Software Development Vanscoy
Lab 3 Part A Assignment

7. Create a unique class that inherits Supervisor. This class must include at least one unique piece
of data related to that type of Employee. The CalculatePay() must be different than a Supervisor.
This type should include a unique bonus based on the length of service.
8. You decide on one other type of Employee that inherits the base class and includes at least one
unique field (data) related to that type of Employee. For example, pay could be based on sales
(i.e. a SalesPerson class).
9. Each derived class has its own version of calculate pay. Each Employee’s pay is determined
based on the unique data stored in its class. Assume the pay period is bi-weekly for all
employees.
10. Come up with a name for a Company Example and declare this data in the base class.
11. Write appropriate matching constructors for every class. Constructors should include key data.
12. Make your own assumptions for validation; however, place a comment with each field or
property stating your assumption. Explore the possibilities. Research other companies and the
types of Employees they have.
13. Add another static Data class that contains at least one method that returns an array of several
hard coded examples of Employees. Have at least 5 of each type. This method is called by an
application to test the objects.
14. Recommended/Optional: Test your code for correctness in a console application.

Marking Scheme:
Base Class 10
Employee Classes 25
Data Class 5
File Management 2
Project Expectations 3

Class Relationships:
Employee

Hourly Supervisor ????

????

TODO:
Create a Class Library assembly for UWP. All classes should be placed in this Library. Compress and Submit the
Class Library along with the UWP Part B solution thru Black Board.

You might also like