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

Assignment Course: Object-Oriented Programming COURSE ID: 503005

This document describes an assignment to implement modules in an employee management system for a software company. Students are tasked with implementing methods in the CompanyManagement class to: 1. Read employee data from input files and populate an employee list 2. Filter the employee list by programming language and return developers matching the criteria 3. Return testers with salaries greater than a given value 4. Return the employee with the highest salary 5. Return the team leader of the group with the most employees 6. Return the sorted employee list The classes Developer, Tester, TeamLeader inherit from Employee and additional properties and methods are described for calculating salaries for each. Sample input/output files are provided to test

Uploaded by

Lê Tường Vy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
81 views

Assignment Course: Object-Oriented Programming COURSE ID: 503005

This document describes an assignment to implement modules in an employee management system for a software company. Students are tasked with implementing methods in the CompanyManagement class to: 1. Read employee data from input files and populate an employee list 2. Filter the employee list by programming language and return developers matching the criteria 3. Return testers with salaries greater than a given value 4. Return the employee with the highest salary 5. Return the team leader of the group with the most employees 6. Return the sorted employee list The classes Developer, Tester, TeamLeader inherit from Employee and additional properties and methods are described for calculating salaries for each. Sample input/output files are provided to test

Uploaded by

Lê Tường Vy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

ASSIGNMENT

COURSE: OBJECT-ORIENTED PROGRAMMING


COURSE ID: 503005
Topic: Module Employee management in an IT company
(Students please carefully read all the instructions before attempting to do the assignment)

I. Introduction
A software company need to manage employees in the company. In this assignment, student needs to
implement some modules in the employee management system. The main objects that need to be
managed are Developer and Tester.
Feature that students need to implement are:
- Read file that contains employee list
- Return employee list that is filtered by specific criteria
- Return employee that is filtered by specific criteria
- Sort employee list
II. Resource
The initial source code has the following files:
- Input file and expected output:
o The input folder contains ListOfEmployees.txt: employee list data, PLInfo.txt: contains
programming languages that employees specialize in
o The output folder contains: 5 files named Req2.txt, Req3.txt, Req4.txt, Req5.txt,
Req6.txt contain expected output of the requirement in the assignment
- Source code file:
o TestCM.java: creates object instance and calls methods that students need to implement
o Employee.java: contains predefined Employee class. Students must not edit this file
o CompanyManagement.java: contains predefined CompanyManagement class that has
property empList (contain employee list), constructor, write file method and many empty
methods. Students need to implement the code for these empty methods and must not edit
predefined methods.
III. Order of doing the assignment
- Students download and extract the given resource files.
- In the same folder of 03 given .java file, students need to create 03 more files corresponding to 3
classes: Developer, Tester, TeamLeader
- Students must complete Developer, Tester, TeamLeader and CompanyManagement class
according to the requirement in the next part.
- After implementing needed methods in the CompanyManagement class, students need to
compile and run the main method in the TestCM.java file that has calls to invoke those methods.
Students implement the solutions according to the requirement and compare the output result
with the expected output in the output folder.
- For requirement that students can’t implement, please don’t remove the methods associated with
those requirements and make sure that the program still runs correctly.
IV. Employee, Developer, Tester, TeamLeader class description
- Developer and Tester class inherit from Employee class, TeamLeader class inherits from
Developer class.
- Properties and methods description:
o Employee class:
▪ empID: Employee ID
▪ empName: Employee name
▪ baseSal: Base salary of employees
▪ abstract method getSalary()
▪ toString(): return string of the format: empID_empName_baseSal
o CompanyManagement class:
▪ empList: an ArrayList to contains Employee list.
▪ CompanyManagement(String path, String path1): Constructor, create empList
by calling the read file method.
▪ getEmployeeFromFile(String path, String path1): Read from file to empList
with path is the path to the ListOfEmployees.txt file which contains employee list
and path1 is the path to the PLInfo.txt file which contains the programming
language list that employees specialize in.
▪ getDeveloperByProgrammingLanguage(String pl): return the list of
developers that satisfies the programming language pl.
▪ getTestersHaveSalaryGreaterThan(double value): return the list of testers that
has the total salary greater than the value.
▪ getEmployeeWithHighestSalary(): return the employee that has the highest
salary.
▪ getLeaderWithMostEmployees(): return the leader of the group with the most
employees.
▪ sorted(): return the sorted employee list empList.
▪ printEmpList(): print empList employee list to the command prompt.
▪ writeFile(String path, ArrayList<E> list): write to file the list of employees
( students must not edit this method).
▪ writeFile(String path, E object): write to a file a generic object (students must
not edit this method).
o Developer class:
▪ teamName: the name of the team. One developer can only belong to one team.
▪ programmingLanguages: the list of programming languages that developers adept
in
▪ expYear: developer year of experience
▪ getSalary(): return salary, will be described below
▪ toString(): return a string of the following format:
empID_empName_baseSal_teamName_programmingLanguages_expYear
With programmingLanguages must be in this format:
[programmingLanguages1, programmingLanguages2, ...]
(Student can check the expected output file for understanding the correct format)

o Tester class:
▪ bonusRate: percentage bonus increase .
▪ type: type of tester (Automation Test - AM/Manual Test - MT).
▪ getSalary(): return salary, will be described below.
o TeamLeader class: TeamLeader is also a Developer, one group can only have 01
TeamLeader.
▪ bonus_rate: percentage bonus increase.
▪ getSalary(): return salary, will be described below.
- Salary calculation description
o Developer
▪ 5 years of experience:
Salary = base salary + years of experience * 2.000.000 (2 millions)
▪ 5 > years of experience >= 3:
Salary = base salary + years of experience * 1.000.000 (1 million)
▪ The remaining cases:
Salary = base salary
o TeamLeader
▪ If Developer is TeamLeader will have bonus increase:
Salary = developer salary + bonus increase * developer salary
(Developer salary is the salary of the developer)
o Tester
Salary = base salary + bonus increase * base salary

V. Input and output file description


- Input file ListOfEmployees.txt contains the list of employees with each row corresponding to the
properties of 01 employee, separated by “,” of the following format:
o Developer
OrderNo.,Employee ID,Employee name,Team name,Years of experience,Base salary

o TeamLeader
OrderNo.,Employee ID,Employee name,Team name,Years of experience,The character
“L” indicates TeamLeader,Bonus increase,Base salary
o Tester
OrderNo.,Employee ID,Employee name,Bonus increase,Type of tester,Base salary

- Output folder contains 5 files with the sample output:


o Req2.txt: sample output of employee list, adept in C++ programming language.
o Req3.txt: sample output of employee list with salary greater than 4,700,000.
o Req4.txt: sample output of employee with the highest salary.
o Req5.txt: sample output of TeamLeader of the group with the most members.
o Req6.txt: sample output of sorted employee list.
- Each row in each output file are associated with 01 employee whose result is the return value of
the toString() method of the associated class:
o Developer, TeamLeader
empID_empName_baseSal_teamName_programmingLanguages_expYear

o Tester
empID_empName_baseSal

Note:
- Students can add samples to the input file to test many different cases but remember to keep the
samples in the right format.
- Students should carefully read the main method to figure out the way to implement classes and
methods.
- Students can add custom methods to the main method to test the implemented methods but make
sure that your implementation can be run on the main method which is provided in original.
- Students can add custom methods but make sure that your implementation still works with the
given TestCM.java file .
- Do not edit the name of the predefined method (follow the class diagram).

VI. Requirement

1. Requirement 1

Students implement method public ArrayList<Employee> getEmployeeFromFile(String path,


String path1) to get the list of employees from the ListOfEmployees.txt file (path) in combination with
reading the PLInfo.txt (path1) file to get the programming languages information of each employee to
initialize Employee object and add them to empList list.

The method printEmpList() is by default called by the main method, if students implement the
getEmployeeFromFile() method correctly, then the list of employees will be printed to the command
prompt when the program is ran.

Note: This is the method that students must implement to start getting points. If you can’t get the list of
Employee instances from the input file then you will not be able to get points from the requirement
below.
All the requirement below is based on interacting with the empList list
2. Requirement 2
Implement method:
public ArrayList<Developer> getDeveloperByProgrammingLanguages(String pl)
return the list of developers adept in the programming language pl. Knowing that the pl argument
always contains only 1 programming language by String.
3. Requirement 3
Implement method:
public ArrayList<Tester> getTestersHaveSalaryGreaterThan(double value)
return the list of testers that have salary greater than the specified value. For example, if the value is
5.000.000 then the returned list of testers must have salary greater than 5.000.000
4. Requirement 4
Implement method:
public Employee getEmployeeWithHighestSalary()
return Employee with the highest salary in the list. If there are equal salaries, return the last person with
the highest salary in the list
5. Requirement 5
Implement method:
public TeamLeader getLeaderWithMostEmployees()
return the TeamLeader that has the most members in the team. If there are equal members case, return
the TeamLeader with the higher years of experience. (Testcase will not have any cases outside the
described case above). Knowing that, one group can only have 1 TeamLeader and one Developer can
only belong to 1 team.
6. Requirement 6
Implement method:
public ArrayList<Employee> sorted()
return the list of employees that is sorted by descending order of salary. If there are equal salary cases,
sort by the first letter (alphabet order) of the employee name (name is the last word in employee full
name). The sorting of employee list is done on a new list of Employee cloned from empList list
(Testcase will not have cases that contain employees with the same salary and the same first letter)

If you implement the methods correctly from Requirement 2 to Requirement 6, when the main method
run, you will get 5 files have the contents same with the samples in output folder.
VII. Note before submission

- For the methods that students can’t implement, please leave it as provided. DO NOT DELETE
THE METHOD OF REQUIREMENT, it will lead to error when running the main method.
Before submission, please check if your program runs correctly with the provided main method.
- All files ReqX.txt (X = {2,3,4,5,6}) must be in the same directory with the directory that
contains the source code. For students that use IDE (Eclipse, Netbeans, …) must ensure that file
can be ran with command prompt, must not be in any package, the position of the output file
ReqX.txt must be in the same directory with the code file.
- The correct output file position when running the program:

VIII. Submission guide


- Students submit Developer.java, TeamLeader.java, Tester.java and CompanyManagement.java,
do not submit any other files except these 4 files and change the name of these 4 files.
- Students put these 4 files into StudentID_StudentName folder (No spacing between StudentName
and no punctuation) and compress the folder to .zip format and follow the submission guide of
your lecturer.
- In the case of not conforming to the submission requirement (wrong folder name, not placing
your implementation into the folder before submission, submission of any other files beside the 4
required files, …) then your score of this assignment is 0
- The correct submission format:
o Compressed file name:

o The folder in compressed file:


o The files in folder:

IX. Regulations and reviews


- Your implementation will be marked automatically by passing them through many testcase (The
input and output files have the described format). Students must take responsibility for not
conforming to the submission guide or changing the name of given methods leading to your
implementation unable to compile during the marking.
- Testcase used to mark is the ListOfEmployees.txt and PLInfo.txt file different from those that
students have received, students can only get the full points of each requirement if all testcase
related to that requirement run correctly.
- If your implementation is unable to compile, then 0 point is given.
- Every implementation is checked for plagiarism. Code that is copied from the Internet,
from your friend or you allowed your friends to copy your code will be given 0 point or
prohibit from participating in the course final exam.
- If your implementation shows signal of copying from the Internet or from your friends, you will
be called for an interview session to prove that your implementation is truly yours.
- The final submission date: 23:00 of 20/05/2021.

-- THE END --

You might also like