Download asm pass java employee management 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 Dinh Nguyen Gia Khanh Student ID GCH Class GCH1003 Assessor name 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
- IV. Implementation.........................................................................................................................................................................................
- 1.explain program structure
- 2.Explain classes
- Account model class
- Mymodel , mymodel2 class
- Employee class
- Explain important algorithms
- Explain how to handle errors:
- V. Test
- VI. Result
- VII. Conclusion
- Figure 1 login design
- Figure 2 register design..............................................................................................................................................................
- Figure 3 table design
- Figure 4 program structure
- Figure 5 demo structure
- Figure 6 all the elements in the structure demo
- Figure 7 import libraries............................................................................................................................................................
- Figure 8 local variables
- Figure 9 object
- Figure 10 getter setter
- Figure 11 hashcode method
- Figure 12 mymodel
- Figure 13 mymodel 2................................................................................................................................................................
- Figure 1 4 employee class
- Figure 15 login
- Figure 16 register
- Figure 17 check
- Figure 18 read and write
- Figure 19 register
- Figure 20 add function..............................................................................................................................................................
- Figure 21 update
- Figure 22 edit
- Figure 23 delete........................................................................................................................................................................
- Figure 24 delete all
- Figure 25 search.......................................................................................................................................................................
- Figure 26 show all data
- Figure 27 add error
- Figure 2 8 choose a row erro
- Figure 29 result
- Figure 30 input and show
- Figure 31 search.......................................................................................................................................................................
- Figure 32 delete........................................................................................................................................................................
- Figure 33 after delete
- Figure 34 edit
- Figure 35 after edit
- Figure 36 delete all
- Figure 37 after delete all...........................................................................................................................................................
III. Ui design Figure 1 login design
- The first thing is the login The user interface design will include a textfield for the user to enter their username and password, as well as a two-button login and register.
Figure 2 register design
- Secondly, the register UI design will include a textfield for the user to enter their username, password, and phone number , as well as a two-button register and cancel.
IV. Implementation
1.explain program structure
- I made a Java application with seven primary components: three jframes called login, register, and table, and four classes called my model, my model2, employee, and account model. Figure 4 program structure
- Then, member variables with methods are declared using the class I defined. Then I'll use them to populate the jframe i've created. I'll use that to develop functions for my software.
- Using the wireframe I made earlier as a guide, I developed my software interface and assigned variable names to each component (button,text fields, label, table, combo box, ...). Figure 5 demo structure
2.Explain classes
Account model class
- I imported the relevant libraries into this class in order to use the variables that I constructed. Figure 7 import libraries
- I designated the local variables with the relevant type(string,integer) as private to limit their use to this class and minimize duplication with variables used in other classes. Figure 8 local variables
- Then I declare variables-containing methods and use those methods to put data into the jframe.
- The first is the manner of startup. This function is used to initialize the objects I defined before. This allows me to initialize values for attributes included within them as well as call other coreresponding methods to initialize the logic contained within the objects.
Figure 9 object
- I then use java's encapsulation using getter and setter methods to specify accessibility for the private attributes I created before and allow them to be seen and edited. Figure 10 getter setter
Mymodel , mymodel2 class Figure 12 mymodel
- First, I imported the necessary libraries into this class so that I could utilize the variables that I created. Next, I made the necessary type's local variables (string, integer) private in order to limit their use to this class and avoid duplication with variables used in other classes. then i created a public class called My Model, implementing ComboBoxModel to store information about my employees' hobbies. Then I make a list called hobbies to store the information. Finally, I created an object to store that information for each of the hobbies as an option in the comboBox.
Figure 13 mymodel 2
variables-containing methods and utilize those methods to populate the jframe with data. The first is the starting method. This method is used to initialize the previously declared objects. This enables me to set values for attributes included within them as well as call other corresponding methods to set the logic contained within the objects. I next utilize Java's encapsulation, which includes getter and setter methods, to define access to the private properties I generated before and allow them to be seen and updated.
3. Explain important algorithms
- This is the "Login button" function. When a user enters their username and password into the text boxes, the application saves them in variables. If the text fields were left blank, the application would display a message window and prompt the user to fill up all text fields. If the username and password given by the user match the accounts in the "accounts list," the user will be able to access the main form. Figure 15 login
- This is the function for “Register button”. If the user press register button, the application will open register form and close the login form. Figure 16 register
- This function is used to check if accounts empty new arraylist will be created. A new data will be added to “accounts” and write in file. Figure 17 check