Assignment Java Programming - Grade D, Assignments of Web Design and Development

An assignment meets 3 criteria P, M, D

Typology: Assignments

2022/2023

Uploaded on 11/24/2023

Long3907
Long3907 🇻🇳

4.8

(5)

20 documents

1 / 159

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Page 1 of 159
ASSIGNMENT 1 FRONT SHEET
Qualification
BTEC Level 5 HND Diploma in Computing
Unit number and title
Submission date
23/06/2023
Date Received 1st submission
23/06/2023
Re-submission Date
Date Received 2nd submission
Student Name
Tran Duc Long
Student ID
GCH210562
Class
GCH1106
Assessor name
Dinh Duc Manh
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)
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download Assignment Java Programming - Grade D and more Assignments Web Design and Development in PDF only on Docsity!

ASSIGNMENT 1 FRONT SHEET

Qualification BTEC Level 5 HND Diploma in Computing Unit number and title Submission date 23/06/2023 Date Received 1st submission 23/06/ Re-submission Date Date Received 2nd submission Student Name Tran Duc Long Student ID GCH 210562 Class GCH1106 Assessor name Dinh Duc Manh 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:

  • I. Introduction
  • II. Requirement
  • III. UI design
      1. Login and Register..........................................................................................................................................................................
      1. Wireframe Homepage
      • a. Subject
      • b. Student
      • c. Register.......................................................................................................................................................................................
      • d. Class division
  • IV. Implementation
      1. Program structure
      1. Classes
      • 2.1. Package exception
      • a. InvalidPersonIdException
      • b. InvalidStudentIdException
      • c. InvalidNameException
      • d. InvalidPhoneNumberException
      • e. InvalidEmailException
      • f. InvalidDateOfBirthException......................................................................................................................................................
      • g. InvalidPasswordException..........................................................................................................................................................
  • 2.2. Package model
  • a. Account
  • b. Subject
  • c. Person.........................................................................................................................................................................................
  • d. Student
  • e. Registering
  • f. Course.........................................................................................................................................................................................
  • 2.3. Package controller.sort
  • a. SortRegisteringByRegisterTime
  • b. SortRegisteringByStudentName.................................................................................................................................................
  • c. SortStudentByName
  • d. SortStudentByStudentIdASC
  • e. SortSubjectByNumOfLesson
  • f. sortSubjectByName
  • 2.4. Package controller
  • 2.4.1 InforFilter
  • 2.4.2 InforFilterImp
  • 2.4.3 DataController
  • 2.4.4 DataControllerImp
  • a. Methods of reading and writing data to file
  • b. Methods of reading and writing data to mySQL in Xampp........................................................................................................ - c. Methods sort by criteria............................................................................................................................................................. - d. Methods createCourse - e. Methods search by criteria - 2.5. Package view - a. LoginFrm - b. SignUpFrm - c. HomeFrm.................................................................................................................................................................................... - d. AddSubjectDialog - e. AddStudentDialog - f. AddRegisterDialog - g. EditStudentDialog....................................................................................................................................................................... - h. EditSubjectDialog
      1. Important algorithms
      1. How to handle errors
      • 4.1. Error when user entered wrong input data
      • 4.2. Error when saving file
      • 4.3. Error when connect xampp
  • V. Test
      1. Test Junit
      • a. DataControllerImpTest
      • b. InforFilterImpTest
      1. Test plan
      1. Testing result................................................................................................................................................................................
      1. Solution
  • VI. Screenshots of running program
      1. Sign up
      1. Login
      1. Tab subject
      • 3.1. Add subject
      • 3.2. Edit subject
      1. Tab student
      • 4.1. Add student
      • 4.2. Edit student
      1. Tab register
      • 5.1. Add register
      1. Tab class division
  • VII. Conclusion
  • Figure 1: Wireframe Sign up and login Table of Figures
  • Figure 2: Wirfeframe tab Subject.................................................................................................................................................................................
  • Figure 3: Wireframe tab student
  • Figure 4: Wireframe tab register
  • Figure 5: Wireframe tab Class division
  • Figure 6: My program structure...................................................................................................................................................................................
  • Figure 7: Class InvalidPersonIdException.....................................................................................................................................................................
  • Figure 8: Class InvalidStudentIdException
  • Figure 9: Class InvalidNameException
  • Figure 10: Class InvalidPhoneNumberException
  • Figure 11: Class InvalidEmailException:
  • Figure 12: Class InvalidDateOfBirthException
  • Figure 13: Class InvalidPasswordException
  • Figure 14: Class account in model package
  • Figure 15: Class Subject
  • Figure 16: Class Person
  • Figure 17: Class Student
  • Figure 18: Class Registering
  • Figure 19: Class Course
  • Figure 20: Class SortRegisteringByRegisterTimeEL
  • Figure 21: Class SortRegisteringByRegisterTimeEL
  • Figure 22: Class SortRegisteringByStudentNameAZ
  • Figure 23: Class SortRegisteringByStudentNameZA
  • Figure 24: Class SortStudentByNameASC
  • Figure 25: Class SortStudentByNameDESC
  • Figure 26: Class SortStudentByStudentIdASC
  • Figure 27: Class sortSubjectByNumOfLessonASC
  • Figure 28: Class sortSubjectByNumOfLessonDESC
  • Figure 29: Class sortSubjectByNameASC
  • Figure 30: Class sortSubjectByNameDESC
  • Figure 31: Interface InforFilter
  • Figure 32: Method isStudentIdValid
  • Figure 33: Method isPersonIdValid
  • Figure 34: Method isNameValid
  • Figure 35: Method isEmailValid
  • Figure 36: Method isPhoneNumberValid
  • Figure 37: Method isDateOfBirthValid.........................................................................................................................................................................
  • Figure 38: Method isPasswordValid
  • Figure 39: Interface DataController
  • Figure 40: Method writeToFile
  • Figure 41: Method readDataFromFile
  • Figure 42: Method connect xampp with netbeans......................................................................................................................................................
  • Figure 43: Method login...............................................................................................................................................................................................
  • Figure 44: Method Register account
  • Figure 45: Methods sort by critiea of Subject
  • Figure 46: Methods sort by critiea of Student
  • Figure 47: Method sort by critiea of Registering
  • Figure 48: Method createCourse
  • Figure 49: Methods search by critiea of Subject
  • Figure 50: Method search by critiea of Student
  • Figure 51: Method search by critiea of Registering
  • Figure 52: Method addActionListener
  • Figure 53: Method actionPerformed
  • Figure 54: Method loadData
  • Figure 55: Method loginSystem
  • Figure 56: Methods catch event
  • Figure 57: Method registerAccounts
  • Figure 58: Constructor in HomeFrm
  • Figure 59: Methods catch events in HomeFrm............................................................................................................................................................
  • Figure 60: Method loadData
  • Figure 61: Method showData
  • Figure 62: Methods to display the Add forms
  • Figure 63: Methods add callback object
  • Figure 64: Methods to display forms Update
  • Figure 65: Methods edit callback object
  • Figure 66: Methods remove data in tables
  • Figure 67: Methods sorting data by critiea
  • Figure 68: Methods refresh data in tables...................................................................................................................................................................
  • Figure 69: Methods search data by critiea
  • Figure 70: Methods AddSubjectDialog
  • Figure 71: Method ClearInputData
  • Figure 72: Method addNewSubject
  • Figure 73: Constructors of AddStudentDialog form
  • Figure 74: Method addNewStudent
  • Figure 75: Constructors of addRegisterDialog form
  • Figure 76: Method searchSubject
  • Figure 77: Method searchStudent
  • Figure 78: Method addNewRegister
  • Figure 79: Method editStudent
  • Figure 80: method showData.......................................................................................................................................................................................
  • Figure 81: Method editSubject
  • Figure 82: Method searchSubjectByName
  • Figure 83: Method searchSubjectByLessonRange
  • Figure 84: Validate process Sign Up account
  • Figure 85: Input data of Student
  • Figure 86: Process write data to file
  • Figure 87: Process read data from file
  • Figure 88: Process connect netbeans to xampp
  • Figure 89: Contructor Class test DataControllerImpTest
  • Figure 90: Methods to test methods sort and search in DataControllerImp class
  • Figure 91: Result test methods in class DataControllerImp by Junit
  • Figure 92: Contructor Class test InforFilterImpTest...................................................................................................................................................
  • Figure 93: Methods to test validate data in InforFilterImp Class
  • Figure 94: Result test methods in class InforFilterImp by Junit
  • Figure 95: Edit code method isNameValid.................................................................................................................................................................
  • Figure 96: Final test results
  • Figure 97: Sign up form
  • Figure 98: Login form
  • Figure 99: Screenshot of subject tab
  • Figure 100: Screenshot of add subject.......................................................................................................................................................................
  • Figure 101: Screenshot of edit subject
  • Figure 102: Screenshot of student tab.......................................................................................................................................................................
  • Figure 103: Screenshot of add student
  • Figure 104: Screenshot of edit student......................................................................................................................................................................
  • Figure 105: Screenshot of Register tab
  • Figure 106: Screenshot of add a new Register
  • Figure 107: Screenshot of class division tab

I. Introduction

I was tasked with developing an app to address a problem faced by small businesses. Specifically, the app aims to assist teachers in effectively managing students and subjects of Greenwich in a straightforward and user-friendly manner. By doing so, it enables them to organize classes for students based on individual subjects, thus resolving the challenges of providing up-to-date information on subjects and class schedules to students. Consequently, I have created a compact project named "Course Enrollment Management System." In this program, I employ a graphical user interface that incorporates the basic functionalities of Create, Read, Update, and Delete. Additionally, I have implemented advanced features like search and sort to enhance the application's functionality. To store and retrieve data, I utilize both file operations and a MySQL database. To ensure a smooth user experience, I have implemented data validation techniques that generate custom exceptions to handle errors. Lastly, I have employed JUnit Test to thoroughly examine all the primary functions of the registering course management program for Greenwich Viet Nam.

II. Requirement

Based on the problem statement provided earlier, the key features of my project are as follows:

  • The application must possess an intuitive and user-friendly interface design.
  • Users should be able to input information conveniently through the use of forms. Register
  • User can register an account with Email and Password. (Email must have the extension @fpt.edu.vn). Login
  • User login with registered user information Home
  • In the main interface of the application I divided into 4 tabs: Subject, Student, Register and Class Division. a. Tab Subjects o The program allows adding Subjects to the table. o The program allows users to view all Subjects information that has been added to the table. o The program allows users to update all information (except ID) of any Subjects.

o The program allows users to sort Registerings by student's name from a-z and z-a. o The program allows users to sort Registerings by Early-late and Late-early registration time. d. Tab Class division o The program allows to create classes with data taken from the subject registration table, student information and subject information. In order to fulfill the requirements mentioned above, I have decided to utilize Netbean tool as the development platform and employ the Java language along with Java Swing. This choice enables me to create high-quality solutions that align with the school's standards.

III. UI design

  1. Login and Register Users must register an account by email with the extension @fpt.edu.vn. After registration is complete, users can log in with the previously registered account to access the system. Figure 1 : Wireframe Sign up and login
  2. Wireframe Homepage

a. Subject After entering the system, the user will see the subject management section: Figure 2 : Wirfeframe tab Subject b. Student The student tab is located next to the Subject section. When the user clicks on the student item, program will switch to the student management form.

Figure 4 : Wireframe tab register d. Class division The Class division tab is located next to the Register section. When the user clicks on the Class division item, program will switch to the create Course form.

Figure 5 : Wireframe tab Class division

IV. Implementation

1. Program structure

The diagram provided illustrates the architecture of my Java application developed with the assistance of netbean coding tools. I have employed the MVC (Model-View-Controller) pattern to ensure efficient code management and establish a logical flow of data within the program. This approach enables a cohesive execution of the program's functionalities.

Figure 6 : My program structure

  1. Classes The successful production of a final product relies on how different classes are organized and how each class approaches a task. Here is a list of all the classes included in the program.

2.1. Package exception

a. InvalidPersonIdException Figure 7 : Class InvalidPersonIdException The above code defines a custom class named InvalidPersonIdException which extends from the Exception class in Java. This class was created to represent a special exception to be used when an error occurs with an invalid person ID. The InvalidPersonIdException class has two properties: invalidId: A string (String) representing an invalid person ID. The InvalidPersonIdException class provides the following methods: InvalidPersonIdException(): Default constructor with no parameters. InvalidPersonIdException(String invalidId, String message): The constructor takes two parameters, one is invalidId representing the invalid person ID and the other is a message representing the message of the exception. getInvalidId(): The method returns the value of the invalidId property. setInvalidId(String invalidId): The method that assigns a value to the invalidId property.