Question: Assignment 11: Optimize your workforce with OOP Overview: In Unit 10, you took an object-oriented approach towards creating employee classes that help the Human Resources

Assignment 11: Optimize your workforce with OOP

Overview:

In Unit 10, you took an object-oriented approach towards creating employee classes that help the Human Resources (HR) department manage vacations and terminations for your growing employee workforce

In this unit, you will expand upon object-oriented programming (OOP) concepts by completing a series of tasks designed to reinforce your understanding of OOP and class relationships. Your company project may also incorporate wrapper classes and automatic conversions to demonstrate competency with objects and arrays of objects if appropriate to your design.

Specification:

Your company has now begun the process of expanding its workforce in four geographic locations, or branches, and requires a program to organize employee staffing. Doing so will help your companys HR department with managing each branch office and assist in determining whether the company needs to add more staff or move employees between locations.

Your program will expand on your employee program from the last unit, so be sure it is working correctly before beginning this one. Your program will organize employees for each branch location and add a manager for each branch.

Employee class

You can use the employee class you created in Unit 10 and add new functionality to meet these requirements.

In addition to the current attributes, you will need to add

  • A four digit employeeID with setter and getter methods
  • A static class variable to track total active employees

The constructor method(s) for the employee class should also increment the class variable.

The terminate method for an employee should decrement the class variable

An appropriate getter should be coded for the static class variable to return total number of active employees.

Branch class

The Branch class needs to model the following attributes:

  • 4-digit location ID
  • location name
  • branchID - a four-digit code to indicate location
  • address
  • A Manager object representing the supervisor
  • an array of Employee objects representing the team

The Branch class needs to model the following methods:

  • Default and parameterized constructors
  • Getter and setter methods for the attributes
  • addToTeam method that takes in an Employee object and adds it to the Team array
  • removeFromTeam method that removes the Employee object from the Team
  • displayBranchInfo method to display the supervisor and team information, as well as the number of employees on the team

Manager class

The Manager class can be formatted similarly to the Employee class with the following attributes:

  • The managers First name
  • The managers Last name
  • The managers full name
  • A 4-digit branch ID

The Manager class needs to model the following methods:

  • default and parameterized constructors
  • getter and setter methods

Main method:

You may create your initial employees, managers, and locations programmatically or via user input.

  • Manager objects should be constructed with a default branchID of 9999
  • Branches should have supervisor and team attributes created but not initialized with values

You will write a menu system that has two main functional areas:

Administration:

Select/enter a branch ID, retrieve the corresponding Branch object and offer these options:

  • Assign a manager to supervise the branch
  • Assign an employee to the branch team
  • Remove an employee from the branch team

Reporting:

  • View a report of manager and employees for a specific lcoation
  • View a cumulative report of all employees sorted by branch location, including total managers and total number of employees for the company

The inputs required for testing your program are:

  • Data for three branch locations: 1000 Baltimore, 2000 Boston, and 3000 New York
  • Data for 3-4 employees per branch. Therefore, you will have a total of 9 -12 employees across the 3 branches
  • Data for at least 3 managers

The data constructs, calculations and decisions required are:

  • At least three classes will need to be created.
  • You may re-use and modify your Employee class from Unit 10. Be sure it is working correctly.
  • You must demonstrate the ability to pass an array of Objects.
  • You will need several arrays to hold your objects.
  • When populating the branch team, you will iterate through the employee array and add the objects as selected to the branch team array. Be mindful to set the length correctly when initializing the team array. Intermediate data structures may be used, and passed into the branch team as an array of objects.
  • When assigning a manager to the supervisor attribute in the branch object, be sure to update the branchID for the manager object, too.

The outputs required are:

  • Menu and reports as described above
  • A provision to inform the user of any exceptions (for example, You have entered an invalid branch ID)
  • All other pertinent information, along with a UML diagram PDF, that continues the theme of your course portfolio

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!