Criterion C: Techniques Used in The Programme
Criterion C: Techniques Used in The Programme
- Inheritance
- Functions
- Classes
- Polymorphism
______________________________________________________________________________
either a “student” or “teacher” (stored in the database). The users have different main interfaces;
data validity; Register.java uses a nested “if” function (explained on page …) for error handling.
Once completed, it generates a random 6-digit code, which is inherited by the child class
Lengthy Functions are used for multiple purposes throughout the programme. They are
used to shorten programming time and the size of the programme. This register function can be
name of the set (second JComboBox). This information is inherited by the AnswerQuestions.java
Subject. The global integer numberOfQuestions increases each time ResultSet returns true for
next(). It then initialises two global String arrays: Terms are inserted into one array, and the
Upon full completion, the students name is inserted into the database: the teacher can view
Polymorphism is used in creating a dynamic clock (user-friendly feature). The clocks can
It provides an interactive input/output interface for the user. The following are specific java
B. JTextFields - Mainly for data entry and displaying information to users. Most text fields
D. JTable - Displaying data and allowing users to select information from the table for editing
databases.
H. JOptionPane - Error-handling and confirming choices by users, which, if made, could lead
3. Libraries
Imported libraries are used to provide email services. This allows for extra security during
registration: the programme sends a 6-digit code to the user, in order to confirm data validity upon
registration.
The teachers can send emails to their students directly. Once studentList.java class is
feature, which is what the client desired, as pointed out in the interview (Appendix 1).
4. Database Connectivity
This code shows types of functions utilised in the programme for database manipulation.
A. Retrieving Data
It gathers data from a specific database table. It uses PreparedStatement and ResultSet.
B. Updating Data
This function replaces the original data in the Database, with new Strings, input through
the JTextFIelds.
C. Deleting Data
This function searches for the desired data in the Database and permanently removes it.
Considering there are a number of database tables, the PreparedStatement uses the String “receive”
to specify from which table the data should be removed; it contains the name of the teacher and
the name of the subject, which is how the tables are named when first created by the “teacher”
users.
D. Adding Data
When the teachers or students create new study sets, a new class is created, a student joins
Lastly, this function is used to create new tables in the database. It allows for the same
teacher to teach more than one subject. Statement creates a table with three distinct Columns: the
Certain classes display different GUI and functions, based on the data inherited from
previous classes. In this example, depending on the type of data inherited, the GUI would display
different elements.
This is mainly used to allow error-handling while the user is entering data. There is an
whether all data is entered; nothing should be unedited. Lastly, the email and the username are
cross-checked with the database of users. Users cannot have identical emails or usernames.
7. Nested Loops
Mostly used with Arrays. The following code removes repeating items from the
JComboBox. At first, all of the items are stored in an array. The nested loops, combined with the
“if” function store only one copy of the items from the original array.
8. Dynamic Searching
It allows users to search for the desired data from a table. When a key is pressed,
getSelectedRow() is used. Vectors clone the original table, which is compared to the characters
used in the search bar (JTextField). The elements not containing a desired search combination (in
References:
- Dimitriou, Kostas, and Markos Hatzitaskos. Advanced Computer Science: for the IB
Diploma Program (International Baccalaureate) High Level Computer Science. Express
Publishing, 2018.
- Dimitriou, Kostas, and Markos Hatzitaskos. Core Computer Science: for the IB Diploma
Program (International Baccalaureate). Express Publishing, 2018.