JAVA Practice T01
JAVA Practice T01
T ra in in g Ex a m
Version 1.1
Hanoi, 02/2019
Training Exams Java Basics (Automation Test) Issue/Revision: x/y
RECORD OF CHANGES
Contents
Problem 01: Control-Flow, Collection .............................................................................................................5
Descriptions: ...............................................................................................................................................5
Estimate time ..............................................................................................................................................5
Mark scale ..................................................................................................................................................5
Problem 02: Database Programming, Exception ...........................................................................................5
Specification ...............................................................................................................................................5
Screen Requirements .................................................................................................................................6
Functional Requirement .............................................................................................................................6
Estimate time ..............................................................................................................................................6
Mark scale : 60 points .....................................................................................................................................6
AT.JAVA.Practice1.T01
Testing date:…………… Allowed time: 150’ Testing score (/10):……….
Account: …………………………………… CODE:
Birth date: …………………………………… AT.JAVA.Practice1.T01
Students are required to develop a Java console application based on Java core and JDBC programming
knowledge learned from the course to manage Trainees in a FA Management System.
Product architecture
Application Layer
(provides the logic and functionality for our
application.)
PropertyManager
Domain objects
(represent things in our application domain)
Persistence services
(handle saving and retrieving data as objects) ConnectionManager
The Application Layer consists of all functions described in the functional requirements section.
The domain layer contains objects and logic related to our application. In this layer, you need to
develop all the entity classes corresponding to your tables in database.
The persistence layer contains data access objects (DAO) that provide services for accessing
persistent data. DAO provide 4 basic services referred to as CRUD:
o Retrieve: find object data in the database and recreate objects. There may be several methods
for this service to enable different forms of object lookup.
In constructor with no parameter of SkillList class, initializing an ArrayList contains the following values:
Java, .Net, Android, NodeJS, Angular, AI.
Create a method named display() to print out all of the elements of the list
Create a method named getHead(int position) to return specific element from the list. If the parameter
'position' is less than 0 or greater than size-1, or in case the list is null/empty, the method will return a
"NULL" value.
Remove an element by a specific value, the method named remove(String skill) returns 'true' if the
skill existing and removed it successfully, otherwise returns ‘false’.
Update an element by index, the method named update(int index, String skillNew).
Create package problem1.management that contains SkillManagment class with main() method to test
above method.
In which:
» gender: trainee gender, only accept value 1: male and 0: female, default null value
» status: trainee status, only accept value ‘active’ and ‘in-active’, default ‘active’ value
Screen Requirements
1 2
....
Functional Requirement
Create a problem2.dao package that contains a TraineeDao class to perform the functions as follows:
1. Adds a new Trainee with active status into databases (method named: save(Trainee trainee))
2. Updates trainee information of an active specific project by account (method named: update(Trainee
trainee))
3. Remove the trainee that was status is ‘in-active’ (method named: remove())
4. List all incompleted training trainees that the gpa <6 (method named: findIncompletedTrainee())
5. List all excellent trainees consist account, full_name, gender, birth_date, gpa that the gpa between
90 and 100 (method named: findExcellentTrainee())
All exceptions in the TraineeDao class methods must be thrown to the TraineeManagement class for
processing.
Create thes other package named problem2.management, create TraineeManagement class that contains
main() method to provide the menu in Screen Requirements.
-- THE END --