Docsity Java Assignment Btec
Docsity Java Assignment Btec
Java Programming
FPT University
28 pag.
JAVA PROGRAMMING
ASSIGNMENT
No.1/1
Class: GCS0904A
Assignment due: March 11th 2022 Assignment submitted: March 10th 2022
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)
IV Signature:
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.
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.
1. Introduction
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.
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
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:
• Goals that your system or application helps those entities (known as actors)
achieve
10
11
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.
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
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.
13
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
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.
15
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
17
18
19
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
21