It is a project of MUST course LP002-Data Structure, which is a grade management system for students. After importing the students' grade data for one or multiple courses, users can browse, sort, and search the data, as well as calculate GPA (Grade Point Average).
- Development Environment
- Install
- Usage
- Highlights
- Design
- Algorithms
- Releases
- Maintainers
- Contributing
- License
System | Windows 10 x64 |
Language | Java 8 |
IDE | Eclipse 2018-12 (4.10.0) |
- Download jdk 8u202 and install.
- Download UGMS_v2.1.jar.
- Execute the binary file without any external plugins.
java -jar UGMS_v2.1.jar
-
Sort
- Click the File and choose Open File option.
- Choose a .txt course file and select the sort approach.
- Click the Display button. (Please import the required files before using GPA sort)
-
Query
- Click the File and choose Import File option.
- Import all the .txt course files which you need and then select the query approach.
- Remember to input the corresponding query message.
- Click the Query button.
Query Message Example ---------------------------------------------------------------------------- ID: 1X09853X-X011-XXXX Surname: Weng WildCard(surname): W, We, We, Weng ... (The first letter must be upper case) GPA Ranging: > 3.0, = 3.0, < 3.0, >= 3,0, <= 3.0 (Need space between the operator and the number)
- Implement a user-friendly GUI.
- Nice output format (JTable).
- Implement advanced query functions such as surname wildcard and GPA ranges.
- Allow the user to add and delete courses.
- Do not depend on any external plugins and environments other than JRE.
- The UGMS sometimes prompts alerts via message windows or checkboxes.
- No need to worry about sort time (<1 sec).
- Student Class
Variable / Function Name | Data Structure | Description |
---|---|---|
sur/giv/id/score/Grade/GPA | Basic type (String/int/double) | The basic info of each student including surname, given name, id, score, Grade, GPA and so on |
credit | 2-dimension array | The student's real credit for every course. ( Parsed by Grade ) |
takecourse | String array | All the courses the student takes |
courseCredit | Int array | Corresponding credit of each taken course |
Student() | / | Constructor |
getsur(), getgiv(), getid(), getscore(), getGrade(), getStuData() | / | Methods to read data from the source file and return corresponding value |
Grade2Credit() | / | Parse Grade to credit |
Credit2Grade() | / | Parse credit to Grade |
computeGPA() | / | Using credit/takecourse/courseCredit to calculate the total GPA |
- Course Class
Variable / Function Name | Data Structure | Description |
---|---|---|
course/coName/credit/num | Basic type (String/int) | Basic info of a course |
GraCount | Int array | Count the number of students in each Grade |
highscore/lowscore/averscore | Int/double | Store the highest/lowest/average score of each course |
Course() | / | Constructor |
gerCourseData() | / | Read data from the source file and return the corresponding value |
- SortAlgorithms Class
Variable / Function Name | Data Structure | Description |
---|---|---|
exchange() | / | Exchange two elements in an array |
less() | / | Compare two elements ( if former < latter then return true ) |
sort() | / | Main sort algorithm |
sortField() | / | Sort data in one aspect |
sortWay() | Stack | Using stack to implement descending order |
- GUI Class
Variable / Function Name | Data Structure | Description |
---|---|---|
contentPane | JPanel | The JFrame window |
fr | JFrame | The Frame |
ReqInput | JTextField | The input of query |
CourseInput | JTextField | The input of course name |
Screen | JTextArea | The main screen |
CourseList | JTextArea | The list of course |
RadioButton 1 & 2 | JRadioButton | The ascending & descending button |
lblCredit | JLabel | The credit label |
lblNumberOfStudents | JLabel | The label of the student number |
AddButton & DeleteButton | JButton | Add & Delete course |
Choice_1 | JComboBox<String> | Sort choice |
MenuBar | JMenuBar | Menu bar |
File | JMenu | Menu name |
closeItem/openItem/importItem | JMenuItem | Menu item |
openDia | FileDialog | File dialog |
sta | Stack | Store the course |
stu | Stack | Store the Student element |
index | int | Used to store course name |
num | int | Index of choice 1 |
num2 | int | Index of choice 2 |
main() | / | Start of the whole program |
myEvent() | void | Operation of the file |
GUI() | / | Constructor ( contains GUI components ) |
IsDifferent() | / | Judge whether the new element is repetitive or not |
IsDifferent(override) | / | Judge whether the new element is repetitive or not |
readtxt() | String array | Read the raw data and split it into groups |
display() | / | Reveal the data |
SortAndOutput() | / | Execute sort and display method |
Query() | / | Based on ReqInput, search for detailed data |
The program adopts Selection Sort with the complexity of
Feel free to open an issue or submit PRs.