0% found this document useful (0 votes)
6 views

LAB 03

The lab task involves creating an Employee Management System (EMS) that tracks employee status and salaries. Students must implement an Employee class, a Manager class, and the EMS class, including methods for registering and removing employees, calculating salaries from a CSV file, and managing salary limits. The task emphasizes proper naming conventions for accessor and mutator methods and includes specific requirements for class fields and constructors.

Uploaded by

esin tan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

LAB 03

The lab task involves creating an Employee Management System (EMS) that tracks employee status and salaries. Students must implement an Employee class, a Manager class, and the EMS class, including methods for registering and removing employees, calculating salaries from a CSV file, and managing salary limits. The task emphasizes proper naming conventions for accessor and mutator methods and includes specific requirements for class fields and constructors.

Uploaded by

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

SE 116 Introduction to Programming II

Lab No: 03 (GRADED)

Topic: Collection Framework

TASK 1:
In this lab, you are responsible for creating an Employee Management System. With the
help of this system, users can keep track of their employees status, salaries and can give
upper bounds to their salaries.

Create an Employee class that has id, name, monthlySalary as class fields. You will
decide on the data types of the following class fields. Implement its accessors and mutators
for the class fields above and parameterized constructor that will assign id and name to
some values except monthlySalary, initialize the monthlySalary field to a default
value as 0.0 in that constructor.

Create a Manager class that has id, name, salaryLimit as class fields. You will
decide on the data types of the following class fields. Implement its accessors and mutators
for the following class fields and parameterized constructor that will assign id and name to
some values except salaryLimit,initiliaze the salaryLimit field to a default value as
0.0 in that constructor.

BE CAREFUL THAT YOUR ACCESSOR AND MUTATOR METHOD NAMES MUST BE IN CAMEL
CASE FORMAT;
For example: monthlySalary’s accessor and mutators should be like this:
getMonthlySalary()
setMonthlySalary()
There can be parameters between parenthesis.

Also, create EMS(Employee Management System) class for handling those employees stuffs
such as calculating their salaries, registering them into system, removing them if they’ve
leave the company. This EMS has name of the company as companyName, Manager of
the company as manager, the Set of Employees they are currently working in the
company as employees, an associative array to represent employees as keys their
monthly salary as values with the following field name as salaryMap. Implement
accessor and mutators for the class fields above and a parameterized constructor for the
only 2 class fields which are name, manager assign other class fields to empty set and
map in that constructor.
registerEmployee(Employee employee); : When registering into system assign his/her salary
into 0 in associative array. Also, don’t forget to add them into set.
removeEmployee(Employee employee);

The EMS should get an .csv file from user with names and daily salaries in it. The EMS should
learn the employee names from this file and will register them into system if they are not
exist in the system. Concurrently, the EMS will calculate the monthly salary of each
employee from that daily salaries total value gathered from that file and will assign that
salary value to each Employee in the system as their monthlySalary. This process will be
done in the following method name;

calculateSalaries(String fileName);

Additionally, EMS has a special feature for Managers. EMS can ask company’s manager to
assign a salary limit optionally. Whenever the system calculates the total salary of each
employee and if there is some salary limit assigned to the system. The system will find the
ones with exceeding this limit and will fire from the company for causing over cost. This
process will be done in the following method name;

askForSalaryLimit();

You will find the salary .csv file in the Blackboard as LAB3.csv

You might also like