


































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Assignment - Java Programming - Vo Minh Quoc Assignment - Java Programming - Vo Minh Quoc
Typology: Essays (university)
1 / 74
This page cannot be seen from the preview
Don't miss anything!



































































❒ Summative Feedback: ❒ Resubmission Feedback:
III. UI Design
2. Classes: There are 4 classes in my program, including: ‘StudentController’ class: contains CRUD functions, check information functions, read/write file functions, sorting student information functions. Those functions have the mission to handle the data and then pass it to the class ‘MainFrame’ which is the view.
‘MainFrame’ class: contain button, table,…, return student information, getting from ‘StudentController’ class, to table functions. This class also handle the button events. ‘App’ is the class main which help running the program.
3. Program structure:
This is structure of my program, including 4 class, ‘Student’ class, ‘StudentController’ class, ‘MainFrame’ class. Whenever the program starts, the view appears and the ‘ReadDataFromFile’ function is called with its function passing the data from file to list and the data will be passed into the ‘ArrayList’, then the data from the ‘Database’ file are passed into the ‘ReadFile’ function. The view contain: Text field of id, name , birthday, email, phone number, and search id and name: to get text for handling. Radio button of choosing genders, add/delete/update functions, and sorting function. Button: Save, Delete, Update, Search Table to display the information of students Whenever user add interact with view, the view will receive user actions such as adding, deleting, updating, the view has the mission to receive data through text field such as id, name text field, the data will be passed into view, followed by controller, and given to a certain function to
handle, then the handled data will be passed into the ‘ArrayList’ and continuedly transferred to ‘WriteToFile’ function in order to write or override them into the ‘Database’ file. The ‘Database’ file, then, will be read by ‘ReadFile’ function, and after that data corresponding with user need will be returned to the view.
4. Important algorithms:
This is a flowchart of adding new student to ‘database.txt’ file
‘ CheckStudentInformationValid( studentInformation ) ’ is a function from ‘StudentController’ class to check if student information is valid or not. When user want to add new student, they need to enter information of that student, if information is null the program will alert and force user to enter information. Then the program receives that information to check it first if it is unique (except for name and birthday) or valid, if not, program will force user to enter again until that information is unique and valid, after everything is correct, the program will process it by add it to array list and write that array list to file.
This is the flowchart of deleting student by id
Then I create the function ‘checkbirthday’ to check the birthday is valid or not, but the when I tried to add birthday with the remaining student information, it appeared the error.