You are on page 1of 27

Higher Nationals in Computing

JAVA PROGRAMMING
ASSIGNMENT
No.1/1

Learner’s name: Truong Tan Tai

Assessor name: Nam Lam

Class: PROG191

Learner’s ID: GCS20079

Subject’s ID:

Assignment due: 10/03/2021 Assignment submitted:08/03/2021


ASSIGNMENT 1 FRONT SHEET
Qualification BTEC Level 5 HND Diploma in Computing

Unit number
and title

Date Received 1st


Submission date 08/03/2021 10/03/2021
submission

Re-submission Date Received 2nd


Date submission

Student Name Truong Tan Tai Student ID GCS200379

Class PROG191 Assessor name Nam Lam

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

Grading grid
Grade (0-10)

Assessment Brief
Student Name/ID Number
Unit Number and Title Object Oriented Programming with Java
Academic Year 2020 - 2021
Unit Tutor
Assignment Number & Design, Implement and Test a GUI application
Title
Issue Date
Submission Date
IV Name & Date

Submission Format
The submission is in the form of a written report. This should be written in a concise, formal business style
using single spacing and font size 12. You are required to make use of headings, paragraphs and
subsections as appropriate, and all work must be supported with research and referenced using the Harvard
referencing system. Please also provide a bibliography using the Harvard referencing system.
Unit Learning Outcomes
LO1 Understand basic programming skills and OOP paradigm
LO2 Understand how to detect errors and handle errors
LO3 Understand how to working with files in applications
LO4 Understand how to build GUI application
Assignment Brief

You have to develop an application to solve a small business problem. The problem requires a graphical
user interface with features that required reading / writing data from text file, working with a collection of
data (searching for item / min / max / sum / etc.). The application must handle errors so that it will not
crash at end user side. The application also need to be fully tested before the production phase.
You need to write a technical report about the development of the application. Content of the report should
cover design, implementation and testing.
In the end you need to demo your application, explain your code and answer technical questions.
Learning Outcomes and Assessment Criteria

LO1 Understand basic programming skills and OOP paradigm


LO2 Understand how to detect errors and handle errors
LO3 Understand how to working with files in applications
LO4 Understand how to build GUI application

To get Pass (5 – 6.5 points)


- Student can design and implement GUI for the application solve a specific problem
- Student knows how to load and save data from file.
- Student knows how to handle errors by using exceptions
- Student knows how to write test plan, execute test cases and log results.

To get Merit (7 – 8.5 points)


- The application is well designed, user friendly and has logical flow of actions.
- Can apply MVC in the application, can apply JUnit to test automatic
- Errors are well handle to avoid program crashing, the test can cover as many as possible the errors
in program

To get Distinction (9 – 10 points)


The application must show excellent design & implementation, runs without any errors, all inputs
are validated, all errors are well handled including recover choice, rich features showing unique
ideas, algorithms.
Table of Contents
1.Introduction..........................................7
2. Rquirment design................................7
2.1 use cases design..............................7
2.2 use case diagram.............................7
3.UI design..............................................8
3.1 Use case 1 design............................8
3.2 use case 2 design.............................9
3.3 use case 3 design...........................10
3.4 use case 4 design...........................11
3.5 use case 5 desgin...........................12
4. implementation.................................13
5. test.....................................................20
6. conclusion.........................................24
TABLE OF FIGURES
Figure 1: employ management use case diagram.....................................7
Figure 2:use case 1 UI..............................................................................8
Figure 3: use case 2 UI.............................................................................9
Figure 4: use case 3 UI...........................................................................10
Figure 5: use case 4 UI............................................................................11
Figure 6: use case 5 UI...........................................................................12
Figure 7: main soruce code.....................................................................13
Figure 8: main soruce code.....................................................................13
Figure 9: main soruce code.....................................................................14
Figure 10: main soruce code...................................................................15
Figure 11:main soruce code....................................................................16
Figure 12: main soruce code...................................................................16
Figure 13: main soruce code...................................................................17
Figure 14: main soruce code...................................................................17
Figure 15: main soruce code...................................................................18
Figure 16: use case 1 interface................................................................19
Figure 17: use case 2 interface................................................................20
Figure 18: result use case 1.....................................................................21
Figure 19: result use case 1.....................................................................22
Figure 20: use case 2 implement.............................................................23
Figure 21: notepad file............................................................................23
Figure 22: use case 2 result.....................................................................24
1.Introduction
The business problem will be fouces on is employee management in computer store. Running a
company with many small stores is often difficult. Many employees will have resumes from
many places so managing their records is essential. The information to be managed includes
basic employee information such as full name, ID number, phone number, home address, gender
and email. A general list of employees, employee salaries, revenue of each store and each
employee's salary are also factors to focus on handling. The creation of an internal application
for the company will make it easy to manage all employee information as well as edit as needed.
2. Rquirment design
2.1 use cases design
Use case 1: create a save tabel information for employees.
Use case 2: review all eployee information are saved
Use case 3: display employee working status
Use case 4: calculate and display the sales of the stores over time
Use case 5: enter and display employee salary.
2.2 use case diagram

Figure 1: employ management use case diagram


3.UI design
3.1 Use case 1 design

Figure 2:use case 1 UI


3.2 use case 2 design

Figure 3: use case 2 UI


3.3 use case 3 design

Figure 4: use case 3 UI


3.4 use case 4 design

Figure 5: use case 4 UI


3.5 use case 5 desgin

Figure 6: use case 5 UI


4. implementation
I will focus on inplement use case 1 and use case 2 because these use cases

Figure 7: main soruce code

These lines of code in figure 7 have the effect of assigning default values for key elements in
employee data entry. Elements include: ID, first name, last name, gender, date of birth, address,
phone number and email. This will be uses to put into orther piece of code so they can know
what target they focus to process

Figure 8: main soruce code


lines of codein figure 8 used to assign values to data input frames on the application's interface.
At the same time, it will be used to connect the values of the default elements to the
corresponding functions. This inclue all active function in interface such as lable for input or
button
Figure 9: main soruce code
Figure 10: main soruce code
Figure 11:main soruce code

The lines of code form figure 9 to figure 11 are used to configure the size and value for input
frames with corresponding value assignments. These number in code ca be changed which is
based on programmer or if we change them in interface design tool, it will be changed too.

Figure 12: main soruce code

The lines of code from figure 12 are used to function event for OK button which will save all
employees information signed in into a bulletin board. All element must be write in to code line
or it will not run in function.
Figure 13: main soruce code

The lines of the code from figure 13 are used to load all employee information data that is saved
in to a file or database. This function event can only run when the file or the database it connect
with have data inside them or it will get error when run.

Figure 14: main soruce code

The lines of the code from figure 14 are used to save all employee information data that is signed
into interface form. This function event help all our employee data not to be lost if they want to
see it or change it in the future. Without this function event, load function event can not run.
Figure 15: main soruce code

These lines of code from figure 15 are used to get back or see the next employees information
saved in file. When load data come in we can use see other employees in list without looking into
file to find their information from previous or next forms
2. run interface

Figure 16: use case 1 interface

Caption:
 this is user interface for first use case
 all element and lable can be able to chang
 inputting wrong type of element will make it not run.
 This interface just includes function event for use case 1 so when combine it with use
case 2 it will be different
Figure 17: use case 2 interface

Caption:
 this is build with the same first use case interface but it have requirmenr function from
use case 2 so it the same with the first iunclude some new function buttons
 must save all data before load data function.
5. test
For use case 1, I will input into some information from some example employees.
First employee:
 ID: 231
 First name: john
 Last name: carter; Gender: male
 Date of birth: 18.12.1974
 Address 153 Harton.Str
 Phone number: 12774853
 Email: joca@gmail.com
Result:

Figure 18: result use case 1

Caption:
 The message only appear when all value added into correctly
 If there is any label get no vlaue, it will not appear.
Second employee:
 ID: 236
 First name: alex
 Last name: forton; Gender: female
 Date of birth: 22.08.1978
 Address: 476 Daten.str
 Phone number: 16674053
 Email: alexF@gmail.com
Result:

Figure 19: result use case 1

Caption:
 The message only appear when all value added into correctly
 If there is any label get no vlaue, it will not appear

For use case 2, we will save all employee information by using Save All Employee Data
Function in File menu button
Figure 20: use case 2 implement

After that , we close the software and these data will be saved into specific file. This is how it
look

Figure 21: notepad file

When to check we just need to press Load all Employee Data in File menu button.
Result:
Figure 22: use case 2 result

We can press next or previous button to check other employees data


6. conclusion
The problem that is posed to be solved is of medium complexity. With the requirements set out in
the problem, we just need to make a simple processing software that must be effective and easy
to use. I have focused on building use cases 1 and 2 mainly in entering, saving and reading data
of employees. Programming a software for employee information management does not require
too many factors, but to ensure that the code is not malfunctioning, the programming must
always be meticulous to avoid errors that may occur in the system. operating process. After
creating the desired results, it can be seen that the software creation process has followed the
correct process and there has been a clear focus on the software.
Reference
1. Itnavi.com.vn. 2021. Use Case là gì? Bí quyết để xây dựng 1 sơ đ ồ Use Case hoàn h ảo.
[online] Available at: <https://itnavi.com.vn/blog/use-case-la-gi> [Accessed 3 March
2022].
2. Góc Học IT. 2021. Các thành phần cơ bản trong một chương trình Java. [online] Available at:
<https://gochocit.com/ngon-ngu-lap-trinh/cac-thanh-phan-co-ban-trong-mot-chuong-trinh-
java> [Accessed 8 March 2022].
3. laura, 2019. What should be in an employee file? | citrusHR. [online] citrus HR. Available
at: <https://citrushr.com/blog/hr-management/what-should-be-in-employee-file/>
[Accessed 8 March 2022].
4. Phước Quang, 2020. Private, Public, Protected và Default trong Java. [online] Viblo.
Available at: <https://viblo.asia/p/private-public-protected-va-default-trong-java-
WAyK80yWKxX> [Accessed 8 March 2022].
5. TopDev. 2022. Wireframe là gì? Cách thiết lập Wireframe hiệu quả? | TopDev. [online]
Available at: <https://topdev.vn/blog/wireframe-la-gi/> [Accessed 3 March 2022].
6. ITNavi, 2021. Tư duy lập trình là gì? Làm thế nào để rèn luyện tư duy lập trình nhanh
nhất và tốt nhất?. [online] Itnavi.com.vn. Available at: <https://itnavi.com.vn/blog/tu-
duy-lap-trinh/> [Accessed 8 March 2022].
7. GmbH, L., 2022. Eclipse WindowBuilder - Creating user interfaces - Tutorial. [online]
Vogella.com.Available
at:<https://www.vogella.com/tutorials/EclipseWindowBuilder/article.html> [Accessed 8
March 2022].
8. Coron, T., 2017. How to create better wireframes. [online] Creative Bloq. Available at:
<https://www.creativebloq.com/advice/how-to-create-better-wireframes> [Accessed 8
March 2022].
9. Dummies.com. 2016. dummies - Learning Made Easy. [online] Available at:
<https://www.dummies.com/article/business-careers-money/business/human-
resources/how-to-maintain-employee-records-189059> [Accessed 8 March 2022].
10. Hartman, J., 2022. What is Java? Definition, Meaning & Features of Java Platforms.
[online] Guru99. Available at: <https://www.guru99.com/java-platform.html> [Accessed
8 March 2022].
11. Vi-et Spaces, 2013. Hướng dẫn sử dụng WindowBuilder để thiết kế giao diện trong
Java. [online] Vi-et Spaces. Available at: <https://vusonbk.blogspot.com/2013/05/huong-
dan-su-dung-windowbuilder-e-thiet.html> [Accessed 8 March 2022].
12. Nguyen Van Hung, 2020. Một số khái niệm cơ bản trong Java. [online] VIBLO.
Available at: <https://viblo.asia/p/mot-so-khai-niem-co-ban-trong-java-Ljy5V1xolra>
[Accessed 8 March 2022].
13. SINGH, C., 2022. Java Programs - Java Programming Examples with Output. [online]
beginnersbook.com. Available at: <https://beginnersbook.com/2017/09/java-examples/>
[Accessed 8 March 2022].
14. ALLABARTON, R., 2021. 6 Steps to Make Your First Wireframe [How To Guide +
Video]. [online] CareerFoundry. Available at: <https://careerfoundry.com/en/blog/ux-
design/how-to-create-your-first-wireframe/> [Accessed 8 March 2022].
15. Nishadha, 2022. Use Case Diagram Tutorial ( Guide with Examples ). [online] Creately.
Available at: < https://creately.com/blog/diagrams/use-case-diagram-tutorial/> [Accessed
8 March 2022].

You might also like