CS244 Final Exam
CS244 Final Exam
TECHNOLOGY
Department: Computer Science
Lecturer: Dr. Omar Shalash
Course Title: Advanced Programming Applications
Course Code: CS244
Semester: Fall 2020/2021 Date: 30/01/2021 Marks: 40
Start Time: 12:30 PM Submission Time: 03:00 PM Max
• Kindly start by writing your: Full name, Registration number, and department on your answer papers.
• Kindly attach a copy of your Student/ National ID to your submitted file.
• Carefully number your answer papers and write the question number you are answering.
• Exam deadline for submission is 03:00 PM 30/01/2021.
• The PDF file which include all your answer papers and ID scans should be renamed to [Your-Full-Name]-
[Your-Reg.Number]-CS244_Final_Answer (without square brackets).
• Submit (Turn in) the Exam on moodle
Answer all questions. Show your work so that partial credits may be assigned
Question #1 (10 Marks):
Circle whether the following statements are True or False, Correct False and
explain your answer in both cases:
T F 1. A subclass can add behavior that is not present in the superclass.
T F 4. Java methods are private by default, which means they cannot be called from
outside of that file.
T F 6. A protected datum or method can be accessed by any class in the same package.
T F 7. To be notified when a user clicks on a button, the program must add an event
handler to the button.
T F 8. To connect to a server running on the same machine with the client, "125.0.0.1"
can be used for the hostname.
a. What may happen if an object of the class mySet is used by multiple threads calling
add( ) and remove( ) at the same time?
b. Change the add( ) and remove( ) methods so that the class mySet can be safely
used by multiple threads at once.
Client 5 marks
Server 10 marks
Question #4 (5 Marks):
Write saveData(String Data[], String serverData[]) method that stores the client data from
previous question into a file named with client name+DateandTime.txt. the data in the file
should define the server data the saves the chat data. For example:
Line 1:AAST
Line 2:250.20.1.4:8080
Line 3:Student_2010010 Saturday, January 30, 2021 01:30:10 PM
Line 4:Hi Frank, How are you?
etc.
Good Luck
Page 4 of 4 EDQMS 2/3