PE PRO192 Fall16 Sample
PE PRO192 Fall16 Sample
HOA LAC
STUDENT INFORMATION
INSTRUCTIONS
Please read the instructions carefully before answering the questions. Do not start until you are told to
do so.
Students are allowed to use any books and materials.
Students are NOT allowed to use mobile phone, Internet, Intranet, Yahoo Messenger, CMS,
USB, and all applications that help share information.
Students are NOT allowed to transmit information and exchange materials with any other
during the examination period.
Students must follow the following requirements (if not will get ZERO):
Students have to copy PEAClient_Version4.zip to computer and use it.
PEAClient_Version4.zip is located on:
\\FSTU\Khao_Thi\03_Exam_Online
For each question, create a folder in your computer that has two sub folder run and src.
Copy .jar file into run sub folder and all source file into src sub folder.
For submitting, chose question number in PEA software, and then attack appropriate folder
was created. Click Submit button to finish submitting this question.
Exam code (Test name): PE_PRO192_Fall16_Sample, Paper No. 1
Question 1:
(3 marks) You have main function which is saved on folder named Q1 already. Use these classes
and functions to test all your operations in this question, DO NOT EDIT ANY CODE in main
function. You can add more operations/classes/interfaces to be able to answer the below questions.
Design and code a class named Person that holds information about a Person. Information of a
Person includes:
A string describes the name of a Person.
Design and code a deriving class named Worker from Person class that holds information about a
Worker. Information of a Worker includes:
A whole value holding salary of a Worker.
A String holding department name of a Worker.
1
Question 2:
(4 marks) You have main function which is saved on folder named Q2 already. Use these classes
and functions to test all your operations in this question, DO NOT EDIT ANY CODE in main. You
can add more operations/classes/interfaces to be able to answer the below questions.
We had provided you:
1. Interface – IBook which will declare some operations on Book – DO NOT EDIT this one.
2. You only need to complete the code in class MyBook and Book.
Design and code a class named Book that holds information about a Book. Information of a Book
includes:
A string describing name of a Book.
An integer value holding price of a Book.
Design and code a class named MyBook which will implement interface IBook and complete 2
methods which were declared in IBook.
String f1(ArrayList<Book> a) – assume that given list “a” is not empty. Write your java code to find
and return name of first book in given list “a”.
int f2(ArrayList<Book> a, int price) – Write your java code to find and return the number of Books in
given list “a” which have price greater than or equals to given “price” (given price as input
parameter).
(3 marks) You have main function which is saved on folder named Q3 already. Use these classes
and functions to test all your operations in this question, DO NOT EDIT ANY CODE in main
function. You can add more operations/classes/interfaces to be able to answer the below question.
Design and code a class named Flight, that holds information of a Flight, including:
A string describes route of a flight as the format of “departure–destination”, for example
HAN-MNL or CDG-SGN…
A whole number describes fare of a flight.