0% found this document useful (0 votes)
116 views29 pages

Docsity Java Assignment Btec

The document describes the design and development of a Java application to manage employee information for a business. It aims to solve the problem of dividing employees into two types and allowing the management of their profiles, timesheets, reviews, and hiring processes. The application requirements include inputting, searching, and saving employee data. It also needs to support 50 users, protect personal data, and have high availability. The design includes a use case diagram showing actors and interactions like adding a new employee. The document will cover the user interface design, implementation details, testing approach, and conclusions.

Uploaded by

Quang Hiển
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
116 views29 pages

Docsity Java Assignment Btec

The document describes the design and development of a Java application to manage employee information for a business. It aims to solve the problem of dividing employees into two types and allowing the management of their profiles, timesheets, reviews, and hiring processes. The application requirements include inputting, searching, and saving employee data. It also needs to support 50 users, protect personal data, and have high availability. The design includes a use case diagram showing actors and interactions like adding a new employee. The document will cover the user interface design, implementation details, testing approach, and conclusions.

Uploaded by

Quang Hiển
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 29

Java Assignment BTEC

Java Programming
FPT University
28 pag.

Document shared on www.docsity.com


Downloaded by: hien-tran-6523 (hilyc6523@gmail.com)
Higher Nationals in Computing

JAVA PROGRAMMING
ASSIGNMENT
No.1/1

Learner’s name: Le Dong Khoa

Assessor name: Nam Lam

Class: GCS0904A

Learner’s ID: GCS2000218

Subject’s ID: 22SP01-PROG191

Assignment due: March 11th 2022 Assignment submitted: March 10th 2022

Document shared on www.docsity.com


Downloaded by: hien-tran-6523 (hilyc6523@gmail.com)
ASSIGNMENT 1 FRONT SHEET

Qualification BTEC Level 5 HND Diploma in Computing

Unit number and title

Submission date March 10th 2022 Date Received 1st submission

Re-submission Date Date Received 2nd submission

Student Name Le Dong Khoa Student ID GCS2000218

Class GCS0904A 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)

Document shared on www.docsity.com


Downloaded by: hien-tran-6523 (hilyc6523@gmail.com)
❒ Summative Feedback: ❒ Resubmission Feedback:

Grade: Assessor Signature: Date:

IV Signature:

Document shared on www.docsity.com


Downloaded by: hien-tran-6523 (hilyc6523@gmail.com)
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.

Document shared on www.docsity.com


Downloaded by: hien-tran-6523 (hilyc6523@gmail.com)
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.

Document shared on www.docsity.com


Downloaded by: hien-tran-6523 (hilyc6523@gmail.com)
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.

Document shared on www.docsity.com


Downloaded by: hien-tran-6523 (hilyc6523@gmail.com)
Contents
1. Introduction…………………………………………………………………………………………1
2. Requirement ………………………………………………………………………………………1
3. UI design……………………………………………………………………………………………..7
4. Implementation…………………………………………………………………………………12
5. Test……………………………………………………………………………………………………19
6. Conclusion…………………………………………………………………………………………20
References ....................................................................................................... 21

Document shared on www.docsity.com


Downloaded by: hien-tran-6523 (hilyc6523@gmail.com)
ASSIGMENT

1. Introduction

Problem solving in business relates to establishing processes that mitigate or remove


obstacles currently preventing you from reaching strategic goals. These are typically complex
issues that create a gap between actual results and your desired outcome. They may be
present in a single team, operational process, or throughout your entire organization, typically
without an immediate or obvious solution.

To approach problem solving successfully, you need to establish consistent processes that
help you evaluate, explore solutions, prioritize execution, and measure success. In many
ways, it should be similar to how you review business performance through a monthly plan
review. You work through the same documentation, look for gaps, dig deeper to identify the
root cause, and hash out options. Without this process, you simply cannot expect to solve
problems efficiently or effectively.

There is a simple business problem that we may have to solve:

In business activities for sales field, we need to have employees. When you step foot into a
store or showroom, you will be greeted by store staff and introduced to you. It's the sales
people. A salesperson is a person responsible for receiving customers, consulting, and
recommending products or business services. But, we need to divide into 2 kinds of
employees. To solve it, we need to create an application that able to manage employee
information. Development work included construction of the core system framework,
creation and management of accounts, employee profiles, and electronic timesheets, and a
foundation for future modules. Those employee management tasks that we selected to
integrate in the system included: employee profiles, electronic timesheets, employee
performance reviews, and the hiring process. I will choose java language to code this
application.

2. Requirement

Functional requirement Non-Functional requirement


- Input employee information - Supports Roughly 50 Users
- Select kind of employee - Protects personal data
- Save employee information - 99% up time
- Searching employee by ID - Cross browser compatibility
- Employee must be able to view system. - Backups
- System must be well documented
- Helpdesk Maintainable server

Document shared on www.docsity.com


Downloaded by: hien-tran-6523 (hilyc6523@gmail.com)
Use-case Diagram:

In the Unified Modeling Language (UML), a use case diagram can summarize the details of
your system's users (also known as actors) and their interactions with the system. To build
one, you'll use a set of specialized symbols and connectors. An effective use case diagram
can help your team discuss and represent:

• Scenarios in which your system or application interacts with people, organizations,


or external systems

• Goals that your system or application helps those entities (known as actors)
achieve

• The scope of your system

Figure 1: Add new Employee

Document shared on www.docsity.com


Downloaded by: hien-tran-6523 (hilyc6523@gmail.com)
Figure 2: Allow Employee to register their role

Document shared on www.docsity.com


Downloaded by: hien-tran-6523 (hilyc6523@gmail.com)
Figure 3: Sell Items

Document shared on www.docsity.com


Downloaded by: hien-tran-6523 (hilyc6523@gmail.com)
Figure 4: Payroll System

Document shared on www.docsity.com


Downloaded by: hien-tran-6523 (hilyc6523@gmail.com)
Figure 5: Report package

Document shared on www.docsity.com


Downloaded by: hien-tran-6523 (hilyc6523@gmail.com)
3. UI Design

Wireframing is a way to design a website service at the structural level. A wireframe is


commonly used to layout content and functionality on a page which takes into account user
needs and user journeys. Wireframes are used early in the development process to establish
the basic structure of a page before visual design and content is added. Here is some
wireframe of the application:
A. Admin login

Figure 6: Admin login

Document shared on www.docsity.com


Downloaded by: hien-tran-6523 (hilyc6523@gmail.com)
B. Add new employee

Figure 7: Add new employee

Document shared on www.docsity.com


Downloaded by: hien-tran-6523 (hilyc6523@gmail.com)
C. Manage Product

Figure 8: Manage Product

Document shared on www.docsity.com


Downloaded by: hien-tran-6523 (hilyc6523@gmail.com)
D. MANAGE SALES

Figure 9: Manage sales

10

Document shared on www.docsity.com


Downloaded by: hien-tran-6523 (hilyc6523@gmail.com)
E. Manage schedule

Figure 10: Manage Schedule

11

Document shared on www.docsity.com


Downloaded by: hien-tran-6523 (hilyc6523@gmail.com)
4. Implementation
A. SOURCE CODE WITH EXPLAINATION BELOW

Figure 11: Main Frame

The first thing I do is to design the frame that using to input, add and load the employee
information, I had to change the variable name to make it easier for my coding part.

Figure 12: Import

Swing is the Graphical User Interface(GUI) widget toolkit for java. and javax is the package
where different classes, interfaces, and other methods are included which are essential for the
swing application development. So, I use “import javax.swing.*” in my program, I can use all
the functionality provided by the swing.

12

Document shared on www.docsity.com


Downloaded by: hien-tran-6523 (hilyc6523@gmail.com)
Figure 13: Open manage employee from another JFrame

Then, I create another frame called admin login and connect with employee management
frame. It will be verry security that you need to have a permission to add new employee. That
will make sure that the system will not be accessed by public people.

Figure 14: Show code

13

Document shared on www.docsity.com


Downloaded by: hien-tran-6523 (hilyc6523@gmail.com)
The next one is going to display the information of employee I have just input to the table.
Separating all the files of information into eight different column and allow admin to add
employee information by creating a new row that contain by default Table Model.

Figure 15: Remind user to input information

Click right mouse the button Save from the designer, there is an option to add event handler.
By doing this, Eclipse will automatically open up the code file for the form. And it will
automatically add an event method to the code. This event method will be triggered,
whenever the button Save is selected. The if … else statement helps me to warn the user to
input all information.

14

Document shared on www.docsity.com


Downloaded by: hien-tran-6523 (hilyc6523@gmail.com)
Figure 16: New and Exit event

I create a button call new, when I click on it, it trigged the event and allow me to rewrite the
information after add the information instead of delete each text boxes and write it again by
hand. And when I want to turn off the system, I just need to click the exit button the system
will automatically turn off.

Figure 17: Class Employee

15

Document shared on www.docsity.com


Downloaded by: hien-tran-6523 (hilyc6523@gmail.com)
The preliminary part of the employee class. When defining the Employee Class, how should
I implement the interface that allows to save with the object of the class and define the data
field definitions, then use the tool to generate constructors and generate getter setter methods,
then the constructor default and constructor with parameters to initialize values for fields of
employee. Constructor It is very important to collect and reload data from files .store files are
objects that are instances of employee class

Figure 18: Load files

To load the files that contain employee information before, I use BufferedReader. To get the
first line string and get the columns name from the first line then set columns name to the
table model. Object[] tablelines = br.lines().toArrays to get the line from the text flies. I use
for loop in order to extract data from lines and set data to table model.

16

Document shared on www.docsity.com


Downloaded by: hien-tran-6523 (hilyc6523@gmail.com)
B. Screenshots of application

Figure 19: Admin login

Figure 20: The final application

17

Document shared on www.docsity.com


Downloaded by: hien-tran-6523 (hilyc6523@gmail.com)
Figure 21: Try to input employee information

Figure 22: Try to edit after input employee information

18

Document shared on www.docsity.com


Downloaded by: hien-tran-6523 (hilyc6523@gmail.com)
5. Test Plan
No Action Expect Test Output Result

1 Add same The Fail


ID of system
employee announce
that have employee
been ID have
existed been
exited

2 Load an The Pass


employee system will
data files display all
have been data
save before

3 Test the The Pass


warning system will
system appear
when message
forgot to box to
input remind
information user

4 Testing exit The Pass


button system will
appear
message
box to
announce
user if they
want to
exit

19

Document shared on www.docsity.com


Downloaded by: hien-tran-6523 (hilyc6523@gmail.com)
6. Conclusion
In conclusion, after solving the problem and checking how my program work successfully. I
see that it is kind of simple and still have a lot of errors. What I mean is there are some
features that haven’t met my expectation. It will be very hard to connect with other frame to
separate kind of employee to manage them. But I see that java lang is very importance for
developer. Java is easy to learn.

Java was designed to be easy to use and is therefore easy to write, compile, debug, and learn
than other programming languages.

• Java is object-oriented.
• This allows you to create modular programs and reusable code.
• Java is platform-independent.
• One of the most significant advantages of Java is its ability to move easily from one
computer system to another. The ability to run the same program on many different
systems is crucial to World Wide Web software, and Java succeeds at this by being
platform-independent at both the source and binary levels.

Because of Java's robustness, ease of use, cross-platform capabilities and security features, it
has become a language of choice for providing worldwide Internet solutions. It have been
help me to meet all the requirement of the system. After all, my program still has a lot of
disadvantages but I’m proud to say that it can be more perfect in the future. I can notice my
weakness and fix it, so my next program will be very expectative. I think that I did it very
well and can help the business issues with add, update, load, delete employee information.

20

Document shared on www.docsity.com


Downloaded by: hien-tran-6523 (hilyc6523@gmail.com)
References
Anon., 2020. [Online]
Available at: https://www.javatpoint.com/java-oops-concepts
[Accessed 8 March 2022].

Bhattarai, H., 2020. [Online]


Available at: https://www.quora.com/What-is-the-meaning-of-import-javax-swing
[Accessed 8 March 2022].

Karma, G. M., 2015. [Online]


Available at: https://www.researchgate.net/figure/Figure-3-Use-Case-Diagram-of-Master-
Package_fig2_288858003
[Accessed 10 March 2022].

Samsoodeen, S., 2021. [Online]


Available at: https://creately.com/blog/examples/use-case-templates-uml/#Payroll
[Accessed 9 March 2022].

21

Document shared on www.docsity.com


Downloaded by: hien-tran-6523 (hilyc6523@gmail.com)

You might also like