JAVA BASICS
T ra in in g As s ig nmen ts
Document Code 25e-BM/HR/HDCV/FSOFT
Version 1.1
Effective Date 20/11/2012
Hanoi, 06/2019
Lab Guides Java Basics Issue/Revision: x/y
RECORD OF CHANGES
No Effective Date Change Description Reason Reviewer Approver
1. 01/Oct/2018 Create new Draft DieuNT1 VinhNV
2. 01/Jun/2019 Fsoft template Update DieuNT1 VinhNV
25e-BM/HR/HDCV/FSOFT v1.1 Internal use 2/5
Lab Guides Java Basics Issue/Revision: x/y
Contents
Day 6. Assignment 5: Project Guides ..............................................................................................4
Objectives: ...................................................................................................................................4
Specifications:..............................................................................................................................4
Business Rules: ...........................................................................................................................4
Functional Requirements: ............................................................................................................4
Screen Requirements: .................................................................................................................5
Guidelines:...................................................................................................................................5
25e-BM/HR/HDCV/FSOFT v1.1 Internal use 3/5
Lab Guides Java Basics Issue/Revision: x/y
CODE: JAVA.M.A501
TYPE: MEDIUM
LOC: 190
DURATION: 180 MINUTES
Day 6. Assignment 5: Project Guides
Objectives:
» To understand basic concept of ArrayList
» To declare and use common methods of ArrayList
» Understand basic concept about Java IO (Character Streams, Buffered Streams)
Specifications:
For the class hierarchy is as follows, the trainee let’s create the java classes install this class diagram to be
able to relationship between it.
Customer Order
Create a class called Customer is designed as follows:
» Four private instance variables: name (String), phone number (String), address (String), and list of
orders (of the class Order you have just created).
» Default constructor.
» One constructor to initialize the name, phone number, address and list of orders with the given values.
Getter and setter methods.
And, a class called Order is designed as follows:
» Two private instance variables: number (String), date (Date).
» Default constructor.
One constructor which constructs an instance with the values given. Gettes and setter methods.
Business Rules:
» phone number: correct phone format
» order number: number string with length equals 10.
Functional Requirements:
a. Write a method to enter customer data with a her/his list order, users will be asked whether to continue or
finish.
Finish typing data when the user selects 'n’ or ‘N' (method named: public List<String>
createCustomer()).
b. Write a method to save the entire customer list entered into the “customer.dat” file (method
named public String save(List<String> customers)).
25e-BM/HR/HDCV/FSOFT v1.1 Internal use 4/5
Lab Guides Java Basics Issue/Revision: x/y
c. The program has a method to get all of customers (method named public List<String>
findAll()).
d. The program has a method to display data in the following format: (method named: public void
display(List<String>)).
Customer Name Address Phone Number OrderList
e. The program has a method to search order by customer (method named public List<String> search(String
phone)).
f. Write a method to remove a specific customer by phone number from customer file (method named public
boolean remove(String phone)).
Screen Requirements:
Guidelines:
» Create a new project named Java.M.A501.
» Package fa.training.entities that contains two classes: Customer, Order.
» Package fa.training.services that contains two classes: CustomerService, OrderService.
» Package fa.training.utils that contains two classes: Validator, Constants.
» Package fa.training.main contains class: Test that contains main() method to run program.
25e-BM/HR/HDCV/FSOFT v1.1 Internal use 5/5