0% found this document useful (0 votes)
4 views34 pages

Java Programming

The document outlines an assignment for a BTEC Level 5 HND Diploma in Computing, focusing on developing a GUI application using Java to solve a small business problem. It includes requirements for design, implementation, testing, and error handling, along with learning outcomes and grading criteria. The student is expected to submit a technical report detailing their application development process and demonstrate their application.

Uploaded by

Tính Đặng
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views34 pages

Java Programming

The document outlines an assignment for a BTEC Level 5 HND Diploma in Computing, focusing on developing a GUI application using Java to solve a small business problem. It includes requirements for design, implementation, testing, and error handling, along with learning outcomes and grading criteria. The student is expected to submit a technical report detailing their application development process and demonstrate their application.

Uploaded by

Tính Đặng
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 34

ASSIGNMENT 1 FRONT SHEET

Qualification BTEC Level 5 HND Diploma in Computing

Unit number and title

Submission date Date Received 1st submission

Re-submission Date Date Received 2nd submission

Student Name Student ID

Class Assessor name

Student declaration

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

Student’s signature

Grading grid

Grade (0-10)

1
❒ Summative Feedback: ❒ Resubmission Feedback:

Grade: Assessor Signature: Date:

IV Signature:

2
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.

3
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.

4
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
5
Assessment Brief.........................................................................................................................................4
I. Introduction:.............................................................................................................................................8
II. Requirement............................................................................................................................................8
III. Wireframe UI design.............................................................................................................................9
1.Main interface.....................................................................................................................................11
2 Explain classes...................................................................................................................................12
3 Explain important algorithms.............................................................................................................20
IV .Test......................................................................................................................................................26
1.Test plan.............................................................................................................................................26
2.Test log...............................................................................................................................................28
V. Results screenshots...............................................................................................................................30
VI. Conlusion............................................................................................................................................34
1.What I leant:.......................................................................................................................................34
2.What I need to improve......................................................................................................................34

6
Answer
I. Introduction:
Currently, the use of word or excel to save information as well as manage students is more and
more. This leads to manual student management that is difficult, delayed, and impossible to
control the right amount. Therefore, I decided to create an application that supports student
management in java. This app helps me to know the exact student information and also the
number of students in that class. Here is my presentation of my application.

II. Requirement
The java program that I created has helped me with the following: I can enter data and can edit
and delete them easily and understandably. Displays include the following values:
+ID
+NAME
+PHONE
+AGE
+GENDER
+EAMAIL
And function keys like:
Add new, edit, delete and sort by name.
All information is displayed clearly for users to understand. Our program can reorder students
with the function of sorting students by name. With an eye-catching interface that is easy to use,
it is suitable for everyone from non-techies to tech-savvy people.

7
III. Wireframe UI design

The basic interface of the program will include labels, corresponding to it are text fields and
combo boxes for users to enter corresponding information. Besides, thereare buttons for users to
interact with the entered data. Finally, a table to display theentered results.

Implementation
1Explain program structure

8
I create a java application, consisting of 2main parts: 1 class named Student.java and
1Jframe named quanly.java
Besides, there is a file to store images named com.mycompany.asm.model.icons.icon

Then the class I created is used to declare member variables with methods. Then I'll use them to
populate the Jframe I've created. Through that, I will create functions for my program I designed
my program interface based on the wireframe I created above, and set variable names for each
element (button, text field, label, table, combo box,...)

9
1.Main interface

Components in Jframe

10
2 Explain classes
In this class, I have imported the respective libraries to use the variables that I created:

11
I have declared the local variables with the corresponding type string as private to make them
only used in this class, avoiding duplication with the variables that I use in the Jframe.

I create a Student class to declare data field variables including: StudentID, name, phone, age,
gender, email.
1. Then I declare methods that contain variables. Through those methods, I push the data inside
the Jframe.

First I built a default Student constructor with no data inside .Then there is the initialization
method. I use this method to initialize the objects that I declared above. This helps me to
initialize values for properties inside it and helps me to call other corresponding methods to
initialize logic inside the object.
Finally, I apply java's encapsulation through getter and setter methods to define accessibility for
the private properties I initialized above and allow those properties to be viewed and modified.
change.

12
13
In this JFame class, I have imported the respective libraries to use the variables that I created

Declare 2 values filltable and initTable to use for the following lines of code

14
This source code declares a value to add information that the user enters into the table

15
This source code declares for users to rearrange the information in the table in order of name (a-
z).

16
This source code declares for the user to edit the information that the user has entered in the
table.

17
This source code declares the entered information listed in a table.

18
3 Explain important algorithms
A. Adding student:

19
20
Explanation:
‘studentInformation’ represents for id, name, gender, birthday, email, and phone number of
student
if(txtStudentId.getText().equals("") is to check if user entered student’s information.
B. Delete student:

21
22
Explanation:
student.getStudentId(). equals(txtStudentId.getText()))} list.remove(student) : helps to
check if the user has entered the id or not otherwise it will give an error

When user want to delete student, they need to enter the id of that student, then the
program receives that id to check it first if it is null or not if yes, program will force user
to enter, after everything is correct, the program will process it by finding student with
that entered id and delete it from array list, after that the array list will be written into file.

4.Explain how to handle errors


When the user uses to add or edit a feature, the following error may occur:

At this time, the application requires the user to enter the necessary basic information for
management such as (Id, Name, and phone number...). The purpose is to save the
information in the table in the most accurate way.
The solution is to enter enough information:

23
When the user wants to delete something, the application will ask to enter the id

Here is the solution:

24
IV .Test
1.Test plan

25
26
2.Test log

27
28
V. Results screenshots
Add

Edit

29
30
Delete

31
Sort by name

32
VI. Conlusion
1.What I leant:
After implementing this project, I
- Learnt how to apply the MVC model into this project to keep the program maintained
and scaled easily.
- Learnt how to handle the event happening through clicking buttons and make
it more logical in order to avoid many errors.
- Acknowledged that using test plan, test case, test log is indispensable, it helps me find
the errors and handle it to avoid the crashing happening when running the program.
- Learnt how to read/write data from file in order to save the data, and load data whenever
user runs the program.
- Learn how to validate input to avoid user enter the wrong information by mistakes.
2.What I need to improve
In terms of the GUI which is interface of program, I found that my application
was not well-designed, user-friendly, and it also has some illogical flow of actions.
- In terms of the program, I found that my program has some errors that I cannot handle,
although they do not make my program crashed when running, they are validated, and my
test covered them as many as possible.
So, in the future, I will learn and invest myself more into it for improve my future
program.

Reference

Deitel, P. a. H., 2012.


JAVA™ FOR
PROGRAMMERS. 2nd ed.
Boston: Pearson Education.

33
Wu, C. Thomas, 2010.
Programming with Java. 5th
ed. New York: Naval
Postgraduate School.
Deitel, P. a. H., 2012. JAVA™ FOR PROGRAMMERS. 2nd ed. Boston: Pearson
Education.
Wu, C. Thomas, 2010. Programming with Java. 5th ed. New York: Naval Postgraduate
School.

34

You might also like