You are on page 1of 30

ASSIGNMENT 1 FRONT SHEET

Qualification BTEC Level 5 HND Diploma in Computing

Unit number and title

Submission date 10th May, 2022 Date Received 1st submission

Re-submission Date Date Received 2nd submission

Student Name Hoang Hai Duy Student ID GCD201678

Class GCD0904 Assessor name Pham Thanh Son

Student declaration

I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand that
making a false declaration is a form of malpractice.

Student’s signature Duy

Grading grid

Grade (0-10)
❒ Summative Feedback: ❒ Resubmission Feedback:

Grade: Assessor Signature: Date:

IV Signature:
Table of Contents
I. INTRODUCTION..................................................................................................................................................6
II. REQUIREMENT...................................................................................................................................................6
III. UI DESIGN........................................................................................................................................................7
IV. IMPLEMENTATION........................................................................................................................................9
1. Program Structure..............................................................................................................................................9
2. Classes..............................................................................................................................................................10
3. Important algorithms........................................................................................................................................13
4. How To Handle Errors.....................................................................................................................................17
V. TEST PLAN AND RESULT...............................................................................................................................20
VI. SCREENSHOTS OF RUNNING PROGRAM................................................................................................27
VII. CONCLUSION................................................................................................................................................30
Table of figures

Figure 1: Home Page...................................................................................................................................................7


Figure 2: Manager and Officer Interface.....................................................................................................................8
Figure 3: Comment Interface.......................................................................................................................................8
Figure 4: Program Structure........................................................................................................................................9
Figure 5: Employee Class..........................................................................................................................................10
Figure 6: Manager Class............................................................................................................................................10
Figure 7: Officer Class..............................................................................................................................................11
Figure 8: ManagerController Class............................................................................................................................11
Figure 9: OfficerController Class.............................................................................................................................12
Figure 10: CommnetController Class........................................................................................................................12
Figure 11: MainController Class...............................................................................................................................12
Figure 12: AddManagerToFile..................................................................................................................................13
Figure 13: ReadManagerFromFile.............................................................................................................................13
Figure 14: SaveManagerToFile.................................................................................................................................14
Figure 15: AddManager 1..........................................................................................................................................14
Figure 16: AddManager 2..........................................................................................................................................15
Figure 17: UpdateManager 1.....................................................................................................................................15
Figure 18: UpdateManager 2.....................................................................................................................................16
Figure 19: DeleteManager.........................................................................................................................................16
Figure 20: ChooseItemFromTable.............................................................................................................................17
Figure 21: Search Manager........................................................................................................................................17
Figure 22: Error 1......................................................................................................................................................18
Figure 23: Error 2......................................................................................................................................................18
Figure 24: Error 3......................................................................................................................................................18
Figure 25: Error 4......................................................................................................................................................18
Figure 26: Error 5......................................................................................................................................................18
Figure 27: Error 6......................................................................................................................................................19
Figure 28: Error 7......................................................................................................................................................19
Figure 29: Error 8......................................................................................................................................................19
Figure 30: Syntax 1...................................................................................................................................................22
Figure 31: Result 1....................................................................................................................................................22
Figure 32: Syntax 2...................................................................................................................................................22
Figure 33: Result 2....................................................................................................................................................23
Figure 34: Syntax 3...................................................................................................................................................23
Figure 35: Result 3....................................................................................................................................................23
Figure 36: Syntax 4...................................................................................................................................................24
Figure 37: Result 4....................................................................................................................................................24
Figure 38: Syntax 5...................................................................................................................................................24
Figure 39: Result 5....................................................................................................................................................25
Figure 40: Syntax 6...................................................................................................................................................25
Figure 41: Result 6....................................................................................................................................................25
Figure 42: Syntax 7...................................................................................................................................................25
Figure 43: Result 7....................................................................................................................................................25
Figure 44: Syntax 8...................................................................................................................................................25
Figure 45: Result 8....................................................................................................................................................26
Figure 46: Syntax 9...................................................................................................................................................26
Figure 47: Result 9....................................................................................................................................................26
Figure 48: Syntax 10.................................................................................................................................................26
Figure 49: Result 10..................................................................................................................................................27
Figure 50: Main Page................................................................................................................................................27
Figure 51: Manager Page...........................................................................................................................................28
Figure 52: Officer Page.............................................................................................................................................29
Figure 53: Comment Page.........................................................................................................................................30
I. NTRODUCTION
I have to create an application to handle a minor business problem for this project. The training
will specifically address the company's compensation problem for the two topics I'd want to
discuss, Manager and Officer. Salary management at the firm is, as can be seen, a pretty limited
function at the moment. So, in order to address this issue for most businesses, I'm launching a little
wage management project named "Employee Management Application."

II. REQUIREMENT

My software will need to contain some of the following features and needs in order to respond to
the present state of things in firms (as I indicated in the introduction):
• The program's interface must be fair and user-friendly.
• Users may handle two major items in this program: Manager and Officer.

• The application allows users to alter additional Manager and Officer Information.

• Users may now see more Manager and Officer Information in the software.

• The application allows users to update Manager and Officer Information.

• The application allows users to erase Manager and Officer Information.

• Users may utilize the application to look for information by Manager and Officer Names.

• When the user departs the software, the program must store the Manager and Officer
information.

• Users can store and load a few basic remarks about Officer and Manager in the software.

• The program must check that the information of the fields must be valid before saving to the file.
To meet the above requirements, I will decide to use Java language together with JavaFX to design
on Scene Builder to be able to offer products suitable for all companies today.
III. UI DESIGN

To begin developing a software system capable of meeting common requirements. The first step is to
create a wireframe to identify what features the interface will have, and then to implement the
wireframe:
• The Home Page will be the first interface as well. The title of the System, as well as three buttons to
go to the new page, will be displayed on this interface.

Figure 1: Home Page

• This second interface will be the interface to manage Manager and Officer. It can be seen on this
interface that the layout is divided equally for both sides. There are 5 fields to enter information: ID,
Name, Age, Month, and Salary. After you've filled out the forms, click the Insert button to see the
information you've put in the table, separated into chevaliers. Furthermore, the Update button refreshes the
required information, whereas the Delete button deletes information that is no longer valid. After hitting
the Search button, the interface also includes a search box where you may look for information on
Managers and Officers by their names. Additionally, the Back button is used to return to the Home Page
and the RefreshTable button is used to return to the original list after searching.

Figure 2: Manager and Officer Interface

• The third and final interfaces are the same. They give a vast area for filling in the descriptions, remarks,
or comments of specific Managers and Officers, as may be seen on this interface. After filling in the
fields, the Save button saves all of the data to the file; the Load button uploads previously saved files; and
the Back button returns you to the Home page.

Figure 3: Comment Interface


IV. IMPLEMENTATION
1. Program Structure

The structure of my JavaFX program is depicted in the diagram below.

Figure 4: Program Structure

• Employee class: This is a super class that holds the most common properties of an employee, such as ID,
Male, Age, and Month.
• Manager class: This is a subclass that inherits properties from Employee and hashave its own
property managerSalary
• Officer class: is a subclass that will inherit properties from Employee class and will have its own
property officerSalary
• ManagerController class: is the class that will control the actions between the view and the model
of the Manager
• OfficerController class: is the class that will control the actions between the view and the model of
Officer
• CommentController class: is the class that will navigate the actions of in the Comment
• Function class: is a class that will include functions to read and write data of Manager and Officer
• MainController class: is the class that will take care of navigating between pages
• Main class: is the class that will take care of executing the program
2. Classes

The separation of classes and how each class approaches a task are critical to the effective completion of a
final project. All of the classes in the program are listed here.
• The first is the Employee class, which takes on the job of the parent class and contains the most frequent
characteristics of a firm employee.

Figure 5: Employee Class

• Class Manager inherits all of the employee class's most common attributes and adds a Manager-specific
property, which is the manager's compensation.

Figure 6: Manager Class


• Class Officer will inherit all the most common properties that the employee class has and will declare
an additional Officer's own attribute, which is the salary of the officer

Figure 7: Officer Class

• The ManagerController class will be responsible for the workflow control provided by the Manager
interface.

Figure 8: ManagerController Class

• The OfficerController class will be in charge of the workflow that the Officer's interface will follow.
Figure 9: OfficerController Class

• The class CommentController will be in charge of the workflow control provided by Comment's
interface.

Figure 10: CommnetController Class

• The MainController class will be the class responsible for navigating the pages that interact with each
other

Figure 11: MainController Class


3. Important algorithms
In this section, I'll go through some of the key algorithms that make the program run smoothly.
• The first algorithm I'd want to discuss is that I built a function called addManagerToFile that writes
the Manager's information into the File, similar to Officer.

Figure 12: AddManagerToFile

• Next I will create a Function called readManagerListFromFile, the function of this algorithm is to read
the data that has been written to the file and similar to Officer.

Figure 13: ReadManagerFromFile


• The SaveManagerToFile function that I have initialized below will perform the task of saving
information after the user updates and similar to Officer.

Figure 14: SaveManagerToFile

• When the user hits the Insert button, I'll create a function that saves the information input by the user to
the File automatically. I'll specifically utilize the function I wrote earlier as addManagerToFlie to add
values according to the fields that the user enters on the interface, as well as Officer.

Figure 15: AddManager 1


Figure 16: AddManager 2

• When the user hits the Update button, I'll create a function that saves the information in the fields that
the user has typed to the File. I'll use the SaveManagerToFlie function I wrote earlier to update the values
for the fields that the user fills on the interface, and I'll do the same with Officer.

Figure 17: UpdateManager 1


Figure 18: UpdateManager 2

• When the user selects the Remove button, the fields specified by the user will automatically get
information from the table corresponding to the position in the File, and then delete the information from
the table and the File with the location. Similar to Officer and corresponding job in File.

Figure 19: DeleteManager


• The ChooseItemFromTable method that I wrote below allows the user to click on a specific Manager's
information, and that information will be presented in the input fields immediately, similar to Officer.

Figure 20: ChooseItemFromTable

• The SearchManager function that I have created below allows users to enter the name of a Manager in
the search box, when the user presses the Search button, the results will display the search results on
the table and similar to the Officer.

Figure 21: Search Manager

4. How To Handle Errors


In this part, I'll go over some of the scenarios that might cause the program to fail, as well as
possible remedies. More precisely, I'll examine the processing flow and correct any validation
issues in the program's input fields as well as any erroneous operations.
• If a user does not enter or leaves a field blank in the Manager or Officer information input areas,
the computer will prompt them to do so.
Figure 22: Error 1

• If the user inputs the Manager or Officer's ID, the application will prompt them to enter a new
ID.

Figure 23: Error 2

• If the age of the Manager or Officer is less than zero, the application will prompt the user to input
the ID again.

Figure 24: Error 3

• The application will prompt the user to re-enter the age of the Manager or Officer if it is less than
22 and more than 55.

Figure 25: Error 4

• If the month of Manager or Officer is between 0 and 12, the application will prompt the user to
input the month again.

Figure 26: Error 5

• The application will prompt the user to re-enter the Manager's salary if it is less than $1000.
When it comes to the Officer, the computer will prompt the user to re-enter the Officer's pay if it is
less than or equal to $ 1000.
Figure 27: Error 6

• If the user enters text in the numeric input fields such as ID, Age, Month, Salary, the program
will notify the user to check if the entered fields are correct.

Figure 28: Error 7

• If the user presses the Update button or the Delete button first, but has not selected the
information of the person who wants to update or delete it, the program will notify the user to
select the object.

Figure 29: Error 8


V. TEST PLAN AND RESULT
No Name of test Test Syntax Day test Expect Actual Analyze Note
content & result results test
Estimate
time
1 View The Figure 30 10/5/2022 View the Figure Correct Pass
Information program (1 hour) informatio 31 test
allows n of result
users to Manager
view added and
Manager Officer
and Officer successful
informatio
n

2 Add The Figure 32 10/5/2022 Add Correct Figure Pass


Information program (1 hour) Manager test 33
allows and Officer result
users to informatio
add n
Manager successful
and Officer
informatio
n

3 Edit The Figure 34 10/5/2022 Edit Correct Figure Pass


Information program (1 hour) Manager test 35
allows and Officer result
users to informatio
edit n
Manager successful
and Officer
informatio
n

4 Delete The Figure 36 10/5/2022 Delete Correct Figure Pass


Information program (1 hour) Manager test 37
allows and Officer result
users to informatio
delete n
Manager successful
and Officer
informatio
n
5 Validate ID The Figure 38 10/5/2022 Enter ID Incorrect Figure Failed
program do (1 hour) not test 39
not successful result
allow users
to enter a
negative
number

6 Validate The Figure 40 10/5/2022 Enter Age Incorrect Figure Failed


Age program (1 hour) not test 41
does not successful result
allow users
to enter
age less
than 22 and
older than
55

7 Validate The Figure 42 10/5/2022 Enter Incorrect Figure Failed


Month program (1 hour) Month test 43
does not not result
allow users successful
to enter
month less
than 1 and
older than
12

8 Validate Fields Figure 44 10/5/2022 Insert not Incorrect Figure Failed


Field cannot be (1 hour) successful test 45
left result
blank

9 Validate ID The Figure 46 10/5/2022 Enter ID Incorrect Figure Failed


program do (1 hour) not test 47
not successful result
allow user
to enter a
String

10 Search The Figure 48 10/5/2022 Search Correct Figure Pass


program Manager test 49
allows result
Figure 30: Syntax 1

Figure 31: Result 1

Figure 32: Syntax 2


Figure 33: Result 2

Figure 34: Syntax 3

Figure 35: Result 3


Figure 36: Syntax 4

Figure 37: Result 4

Figure 38: Syntax 5


Figure 39: Result 5

Figure 40: Syntax 6

Figure 41: Result 6

Figure 42: Syntax 7

Figure 43: Result 7

Figure 44: Syntax 8


Figure 45: Result 8

Figure 46: Syntax 9

Figure 47: Result 9

Figure 48: Syntax 10


Figure 49: Result 10

VI. SCREENSHOTS OF RUNNING PROGRAM

The employee management system's main screen interface is seen below, with the system's title bar
"Employee Management Application" and the Manager and Officer buttons for switching to the Manager
and Officer management pages, respectively.

Figure 50: Main Page

Move the button to the Manager Management page after leaving the interface page. The image below depicts the
page's structure, which includes fields to fill in information, a table to display information after it has been
successfully added, and three buttons to perform its functions: "Insert," "Update," and "Delete," as well as a field to
search for information, a button to refresh the table after searching, and a "Back" button to return to the Main Page.

Figure 51: Manager Page


Figure 52: Officer Page

Finally, there is the page with the comments. Users will see a huge section on this page where they may
input various Manager and Officer Descriptions. The "Save" button saves the material that will be
imported into the file, the "load" button uploads already stored content, and the "Back" button returns to
the main screen.
Figure 53: Comment Page

VII. CONCLUSION
To summarize, I learned a lot of information after successfully completing this job. Let's start by
describing the project's aim, then breaking down the requirements and objectives into smaller chunks to
make specifying what we need to do easier. a major objective Then I must build the wireframes for my
pages, and in order to do so, I must rely on the requirements as well as the objectives to design the
functionality, and I must also be familiar with specific tools. Understand The Java language and the
JavaFX platform system, which were utilized to create the program, will be discussed further. I had to
spend some time studying IntelliJ in order to use the Java programming language and the JavaFX platform
system. It's time to check for mistakes after completing the code execution phases. To do error checking, I
must first create a test plan, after which I must implement those cases in the code to improve the user
experience even more. Following the completion of the preceding steps, the product launch phase will
begin. Users will be able to test the application and provide comments in order to help improve it.

You might also like