Download BTEC Level 5 HND Diploma in Computing Assignment: Developing a Student Information System and more Assignments Java Programming in PDF only on Docsity!
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 Phan Minh Tiến Student ID GCD2 01914
Class GCD1001 Assessor name Phạm Thanh Sơn
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)
❒ Summative Feedback: ❒ Resubmission Feedback:
Grade: Assessor Signature: Date:
IV Signature:
- Introduction
- Requirement
- Some requirements from the bussines problem:
- UI Design
- Definition of Wire Frames
- Wired Frames of my Program
- Implementation
- A. Explain program structure
- B. Explain classes.....................................................................................................................................................
- C. Explain important algorithms
- D. Explain how to handle errors
- Test..........................................................................................................................................................................
- A. Test Plan
- B. Test Case
- Results
- Screenshots of the running program
- Conclusion
- Figure 1: Mockup of WireFrame Table of Figure
- Figure 2: Mockup of StudentForm
- Figure 3: Overall structure of program
- Figure 4: MVC................................................................................................................................................................
- Figure 5: Handle request of adding a new Student
- Figure 6: Handle the data
- Figure 7: SinhVien(constructure)
- Figure 8: SinhVien(getter and setter)
- Figure 9: SinhVienList(add and getAllSinhVien)
- Figure 10: SinhVienList(deleteSinhVienByID, getSinhVienByID, and updateSinhVienByID)
- Figure 11: SinhVien(getOneStudentByMaSV)
- Figure 12: SinhVienView(Constructor)........................................................................................................................
- Figure 13: SinhVienView(setModel)
- Figure 14: SinhVienView(getDuLieu)
- Figure 15: SinhVienView(TableMouseClicked)
- Figure 16: SinhVienView(fillDataTABLE)
- Figure 17: SinhVienView(button Save)
- Figure 18: SinhVienView(reset)...................................................................................................................................
- Figure 19: SinhVienView(button_Add)
- Figure 20: SinhVienView(button Edit).........................................................................................................................
- Figure 21: SinhVienView(button Delete)
- Figure 22: SinhVienView(button Search)
- Figure 23: SinhVienView(button_ChonAnh)
- Figure 24: SinhVienView(writeFile).............................................................................................................................
- Figure 25: SinhVienView(readFile)
- Figure 26: SinhVienView(fOpen)
- Figure 27: SinhVienView(menu_Open, menu_About, menu_Exit, menu_Save)........................................................
- Figure 28: Main
- Figure 29: SinhVienView(Varibles)
- Figure 30: Set fields.....................................................................................................................................................
- Figure 31: Check whether existed ID
- Figure 32: Add new product to list
- Figure 33: Clear input text
- Figure 34: SinhVienView(button_Add)
- Figure 35: Handle for delete button
- Figure 36: deleteSinhVienByID function
- Figure 37: Validate Empty
- Figure 38: Validation for name
- Figure 39: Check ID
- Figure 40: Check Format Date
- Figure 41: Show message Error format Date
- Figure 42: Run MainFrame..........................................................................................................................................
- Figure 43: Run SinhVienForm
- Figure 44: Fill Data Form from Table
1. Introduction
A university needs a GUI program that uses the Java programming language to manage its students. The
program must ensure that the User can enter the student's personal information such as Student ID,
Student name, date of birth, gender, address, etc. In particular, the program must also have basic functions
such as Create, Read, Update and Delete Student. In addition, need to add a Search function to find and
update students more easily.
2. Requirement
Some requirements from the bussines problem:
- The program must have four basic CRUD functions.
- Force users to enter all data fields (Data cannot be empty)
- The student information data after saving the file will be saved to the file. And the data can also be
retrieved from the file that the hero has previously saved.
- The user is required to enter the correct format of the student's date of birth and name.
- In the Create function, the Student ID must be valid to avoid creating two students with the same ID.
- In Edit function, user is allowed to update all basic information of student except Student ID.
- In Delete function, user is allowed to delete Student's data by Student ID. 3. UI Design
Definition of Wire Frames
A wireframe is a visual guide that shows where visual and UI components are positioned
on a website's skeleton architecture. Wireframes are short mockups of how a website's parts
should be arranged to achieve a certain goal, such as aesthetics or usability. This allows
stakeholders to instantly see where website pieces are located without having to wait for the
designer to build a real site, which speeds up the design selection process.
Figure 2: Mockup of StudentForm
4. Implementation
A. Explain program structure
Figure 3: Overall structure of program
Three main parts made up the overall structure:
I used the MVC architecture to develop the program's framework to make it easy to utilize the program.
Making a model is the initial phase, which is where we work with the data. When we make modifications
to the program, the second is an upgrade or helper that will handle issues, save files, and load files. The
Since the data will be saved to the location where we supply the path for writing files, there won't be any
data loss. Additionally, it acts as the controller. All methods will be called in the end, which is From View,
which is also a crucial part of running the program. Further, the program's chief controller is in charge of
managing every part of it.
The overall structure has 3 main parts:
The first is package model. It’s includes: class SinhVien and class SinhVienList. The main purpose
of this package is interact with data.
The Second is package utilities. It’s includes: Class validation and validator. They used to check
format and check empty when you implement each function of each button.
The finally is package view. It’s includes: Form FrMain and Form SinhVienView.
Form FrMain: This form just used to create beatiful title progam
Form SinhVienView : This is where the methods and functions of the main program are
located. Operations such as readFile and writeFile are called and used in this package. When
we process the information in the program, after exiting the data will not be lost if you click the
Save file button before exiting the program, then the data will be passed through the WriteFile
function to save the data in the file. After you run the program again, the data will be output
from the file through the ReadFile function.
B. Explain classes
Package model
Class SinhVien.java
Figure 7: SinhVien(constructure)
Variables used in the program will be called in this class. The SinhVien constructor will be called when
the object is created which means the constructor will run first before the rest of the functions. It will
assign the value of parameter to the variable we have been created. Especially, I read file with object so I
use implements Serializable to read file Object.
Figure 9: SinhVienList(add and getAllSinhVien)
I create list for SinhVien to create each Student and get All Student.
Figure 10: SinhVienList(deleteSinhVienByID, getSinhVienByID, and updateSinhVienByID)
I create methods includes deleteSinhVienByID, getSinhVienByID, and updateSinhVienByID to delete
and update Student.
Figure 11: SinhVien(getOneStudentByMaSV)
Figure 14: SinhVienView(getDuLieu)
The getDuLieu() function is used to get the data from the entered fields.
Figure 15: SinhVienView(TableMouseClicked)
This function has the effect of considering each student's ID to get data from each student about the table
through the setModel() function.
Figure 16: SinhVienView(fillDataTABLE)
fillDataTABLE method is used to dump data into the table.
Figure 17: SinhVienView(button Save)
In this function, I conduct a check validateform to check if the input fields are empty and require the user
to enter enough information and in the correct format. In addition, I also check if the student ID in the
table matches the student I intend to add. If there is a match, the message "Student ID existed" will be sent
and the student will not be saved. Otherwise, it will proceed to save the data to the table.
Figure 18: SinhVienView(reset)
reset() method is used to reset all data fields to null value.
Figure 22: SinhVienView(button Search)
At the Search button, I proceed to validate the Student Code, if it is empty, it will report an error, if the
student data is not in the file, it will continue to report that it does not exist. Otherwise, proceed to search
data by ID and dump the searchable data into all fields.
Figure 23: SinhVienView(button_ChonAnh)
At a button Chon Anh, I use JFileChooser to get the default images from the file into the label and
consider limiting the images so that it fits in a frame.
Figure 24: SinhVienView(writeFile)
I use the write file method to write data to the file. To ensure the safety of the program, I use try-catch to
close the file.