CS244 Final Exam Spring 2019-2020 v2.0
CS244 Final Exam Spring 2019-2020 v2.0
TECHNOLOGY
Department:
Lecturer: Dr. Omar Shalash
Course Title: Advanced Programming Applications
Course Code: CS244
Semester: Second 2019/2020 Date: 13/06/2020
Time: 2 Hours Marks: 40
• 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 11:30 am 13/06/2020.
• 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.
• Submit (Turn in) the Exam on Google Classroom
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:
TF 1. Java programs can be compiled and run from the command line.
TF 2. You can invoke “socket.InetAddress()” on a Socket object, say socket, to obtain an InetAddress
object.
TF 3. The name of a Java class must begin with a capital letter; otherwise the program will not run.
TF 4. Java methods are private by default, which means they cannot be called from outside of that
file.
TF 6. A method signature includes information about the number and types of parameters that a
method has.
TF 7. To be notified when a user clicks on a button, the program must add an event handler to the
button.
TF 8. To connect to a server running on the same machine with the client, "125.0.0.1" can be used
for the hostname.
3. If an exception occurs in a try-catch block, the code in the finally clause ________.
a. is not executed if the exception is caught
b. is not executed
c. may be executed
d. is executed
e. None of the above.
For the purposes of this question, you can assume that the following variables have been declared and
initialized, if necessary:
Restaurant restaurant;
String restName;
String restAddress;
String menu;
Person restOwner;
String ownerName;
String[] dessertList;
(3 points) Part b:
c. A Scene object for a pane with width and height 100 and 200.
d. Find the number of objects in a list? +indexOf(o: Object) : int Returns the index o
+isEmpty(): boolean Returns true if this
+lastIndexOf(o: Object) : int Returns the index o
f. Remove a given object from a list? +remove(o: Object): boolean Removes the eleme
+size(): int Returns the number
+remove(index: int) : boolean Removes the eleme
g. Remove the last object from the list? +set(index: int, o: E) : E Sets the element at