Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CSC 251 Project 1 HR Application for Employees and Payroll Overview and Requirements You are to write an application to allow a Human Resources department

CSC 251 Project 1 HR Application for Employees and Payroll

Overview and Requirements

You are to write an application to allow a Human Resources department enter Employee, Manager and Executive data, generate payroll information, and list various subsets of employees. This program uses enhanced versions of the Employee/Manager/Executive program in the Inheritance lab, and an enhanced version of the DataSetGeneric program in the Generics lab. Reusing code from those labs can significantly help in completing this project.

In particular, the user of this application will be able to

  • Create employees, managers, and executives and store them in a data store.
  • List all employees,
  • List only regular employees (i.e., omitting managers and executives)
  • List only Managers
  • List only Executives
  • Show the highest paid employee
  • Generate a payroll

Provided Materials

The attached zip file contains two folders:

  • doc contains Javadoc information for some of the classes and interfaces the program requires. Code that you write must adhere to these specifications. This folder must be extracted (browsers dont work well looking a files in an archive). Once extracted, open the index.html file with a browser. Javadoc pages are provided for
    • DataSetGeneric , which is a class you must provide. There are enhancements to the DataSetGeneric class beyond your class from the Generics lesson. Note the package specification for DataSetGeneric. My DataSetGeneric solution uses inheritance, but you are free to choose a different solution. But your implementation must support the methods defined in the javadoc, plus add and size methods with the same behavior as ArrayList.add and ArrayList.size.
    • Payroll, the main method for the program.
    • Utils contains static methods for menu management.
    • Measurable, an interface exploited by DataSetGeneric and implemented by the Employee/Manager/Executive classes
    • Screener, an interface that must be created and implemented to exploit the DataSetGeneric enhancements.
    • Note the package specifications on these classes and interfaces.
  • src contains the package structure and starter code. Starter code for the following interfaces and classes are provided
    • Measurable is defined in full
    • Payroll, which you must complete. DO NOT MODIFY THE main METHOD. You can complete the project by completing the method bodies such as addEmployee and displayEverybody, etc.
    • Utils is provided in full

JUnit

Provide JUnit tests for all completely new methods. For example, each Screener implementation should have its test method called with an Executive, a Manager and an Employee object, and the correct value verified.

DataStoreGenerics getList methods should be called and their return values verified. In particular, the getList(Screener.) signature should verify that various object types are correctly include or excluded from the output.

These tests dont have to be large or elaborate. Create test dummy Employee, Manager, and Executive objects (hard coded), and call the various Screeners with each of them. Verify the proper true/false return value of test. Thats nine very simple tests.

Similarly, create a DataSetGeneric object and feed your dummy Employee/Manager/Executive objects to it. Then test getList(), and getList with each Screener, and verify the output. That would be four tests, each with the same setup.

Measurable

The measure of an Employee is the Employees salary.

Hints and Suggestions

  • Dont use Scanners nextLine. Keep names (employee name, department names) limited to a single word; thats how Ill test. Doing this will let you limit Scanner to next, nextInt, and nextDouble.
  • Plan the order of your development and testing. One strategy would be to comment out the method definitions and if statement in Payroll. Complete DataSetGeneric to the point that Payroll will compile. Then uncomment the code in Payroll associated with one user action and test it. When thats working, uncomment another user action, test it, etc. Program in small chunks, and test immediately.
  • For Screener implementations, dont forget the instanceof operator. Plus, the following incantation will return a String with the simple name of the concrete class for an object obj: obj.getClass().getSimpleName(). So if obj was created via new Manager, the simple name will be Manager. obj instanceof Employee is true in this case, because a Manager object is also an Employee object.

Grading Elements

The program

  • Contains all classes and interfaces as described in the Javadoc documentation
  • Contains an inheritance hierarchy Employee/Manager/Executive as defined in the Inheritance lesson
  • Enhances Employee/Manager/Executive to be Measurable
  • Contains a generic DataSetGeneric class. Objects of this class are declared to contain only Employees or its subclasses
  • Enhances DataSetGeneric to use Screener objects to return subsets of its elements
  • Contains Screener objects to identify Employees, Managers and Executives
  • Has all classes and interfaces in the appropriate packages
  • Enhances the Payroll program to support the specified user interaction
  • Does not modify Payroll.main
  • Provides at least thirteen different JUnit tests
    • each implementation of Screener is tested with an Employee, a Manager and an Executive object (nine tests)
    • DataSetGeneric.getList() that returns the entire store (one test)
    • DataSetGeneric.getList with a Screener parameter is tested that the elements of the store are returned, or not, appropriately (three tests)

Sample Execution

Make a Selection:

[0] Exit

[1] Add Employee

[2] Add Manager

[3] Add Executive

[4] List All

[5] List (Regular) Employees

[6] List Managers

[7] List Executives

[8] Show Highest Salary Person

[9] Generate Payroll

2

Name pointy-hair

Enter Salary 66000

Enter Department Managed development

Make a Selection:

I was unable to Add the Payroll Code into this Let me know if u need me to post it in a seperate Question

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions