SlideShare uma empresa Scribd logo
1 de 17
Baixar para ler offline
EXAMINATION AND EVALUATION DIVISION 
DEPARTMENT OF POLYTECHNIC EDUCATION 
(MINISTRY OF HIGHER EDUCATION) 
INFORMATION & COMMUNICATION TECHNOLOGY (ICT) 
DEPARTMENT 
FINAL EXAMINATION 
JUNE 2012 SESSION 
FP301: OBJECT ORIENTED PROGRAMMING 
DATE: 21 NOVEMBER 2012 (WEDNESDAY) 
DURATION: 2 HOURS (2.30PM-4.30PM) 
This paper consists of SEVENTEEN (17) pages including the front page. 
Section A: Objective (40 questions – answer ALL) 
Section B: Structure (2 questions – answer ALL). 
CONFIDENTIAL 
DO NOT OPEN THIS QUESTION PAPER UNTIL INSTRUCTED BY THE CHIEF INVIGILATOR 
(The CLO stated is for reference only)
CONFIDENTIAL FP301 OBJECT ORIENTED PROGRAMMING 
Page 2 of 17 
SECTION A 
OBJECTIVE QUESTIONS (50 marks) 
INSTRUCTION: 
This section consists of FORTY (40) objective questions. Answer ALL questions in the answer booklet. 
1. UML is the acronym of _________________________ [CLO1] 
A. Unification Multi Language 
B. Unify Multimedia Language 
C. United Modeling Language 
D. Unified Modeling Language 
2. Which of the following terminologies is used to describe the data component in UML class diagram. [CLO1] 
A. Attribute 
B. Method 
C. Object 
D. Class 
3. Which of the following define the best statement of object oriented analysis? [CLO1] 
A. The process of defining the problem in terms of real-world objects with which the system must interact 
B. The process of defining the components, interfaces, objects, classes, attributes, and operations that will satisfy the requirements 
C. The process of defining the problem, scenario, and operations that will satisfy the requirements 
D. The process of defining the components, interfaces, objects, classes, attributes, and operations which the system must interact 
4. Which of the following statements is correct? [CLO1] 
A. Every class must end with a semicolon. 
B. Every comment line must end with a semicolon. 
C. Every line in a program must end with a semicolon. 
D. Every statement in a program must end with a semicolon
CONFIDENTIAL FP301 OBJECT ORIENTED PROGRAMMING 
Page 3 of 17 
5. What is byte code in the context of Java? [CLO1] 
A. It is the code written within the instance methods of a class. 
B. The type of code generated by a Java Virtual Machine. 
C. The type of code generated by a Java compiler. 
D. It is another name for a Java source file. 
6. Select the best description about data type. 
[CLO1] 
A. The part of the CPU that does arithmetic. 
B. A part of main memory used to store data. 
C. The collection of variables that a program uses. 
D. A particular scheme for representing values with bit patterns. 
7. Why is main() method special in a Java program? [CLO1] 
A. It is where the Java interpreter starts the whole program running. 
B. Only the main() method may create objects. 
C. Every class must have a main() method. 
D. The main() method must be the only static method in a program. 
8. The act of creating an object of given class is called ___________ [CLO1] 
A. Declaration 
B. Referencing 
C. Instantiation 
D. Implementation 
9. Which one of the following illustrates proper naming convention in Java programming style? [CLO1] 
A. int StudentName; 
B. final double MAXVALUE = 3.547; 
C. public class compute_Area(){} 
D. public static int ReadDouble(){}
CONFIDENTIAL FP301 OBJECT ORIENTED PROGRAMMING 
Page 4 of 17 
10. What value will be the result if you attempt to add an int, a byte, a long and a double? [CLO1] 
A. byte 
B. int 
C. long 
D. Double 
11. Which of the following statements correctly creates an input stream by user input? [CLO1] 
A. BufferedReader kb = new InputStreamReader(System.in); 
B. BufferedReader kb = new BufferedReader( ); 
C. BufferedReader kb = new BufferedReader(InputStreamReader(System.in)); 
D. BufferedReader kb = new BufferedReader (new InputStreamReader 
(System.in)); 
12. This operator performs an arithmetic or signed right shift. Which of the following is the symbol of the operator? [CLO1] 
A. >> 
B. >>> 
C. << 
D. <<< 
13. Which of the following statements is correct to display Welcome to Java?[CLO2] 
A. System.out.println('Welcome to Java'); 
B. System.out.println("Welcome to Java"); 
C. System.println('Welcome to Java'); 
D. System.print('Welcome to Java'); 
14. Given a java class as follows: 
In order to compile this program, the source code should be stored in a file _____ 
[CLO2] 
A. Test.class 
B. Test.java 
C. Test.doc 
D. Test.txt 
public class Test {}
CONFIDENTIAL FP301 OBJECT ORIENTED PROGRAMMING 
Page 5 of 17 
15. Consider the following code snippet: 
What would you write in order to instantiate MyClass? [CLO2] 
A. MyClass mc = new MyClass(); 
B. MyClass mc = new MyClass; 
C. MyClass mc = MyClass(); 
D. MyClass mc = MyClass; 
16. Which will legally declare, construct, and initialize an array? [CLO2] 
A. int [] myList = {"1", "2", "3"}; 
B. int [] myList = (5, 8, 2); 
C. int myList [] [] = {4,9,7,0}; 
D. int myList [] = {4, 3, 7}; 
17. What are the three parts of a counting loop that must be coordinated in order for the loop to work properly? [CLO2] 
A. Initializing the condition, changing the condition, terminating the loop. 
B. Initializing the counter, testing the counter, changing the counter. 
C. The while statement, the if statement, and sequential execution. 
D. The while, the assignment, and the loop body. 
public class MyClass{ 
public MyClass() 
{ /*code*/ } 
}
CONFIDENTIAL FP301 OBJECT ORIENTED PROGRAMMING 
Page 6 of 17 
18. Analyze the following code: 
Select the best statement that describes the program [CLO3] 
A. The program has compile errors because the variable radius is not initialized. 
B. The program has a compile error because a constant PI is defined inside a method. 
C. The program has no compile errors but will get a runtime error because radius is not initialized. 
D. The program compiles and runs fine. 
19. Examine the following code: 
What is the output? [CLO3] 
A. 1 2 3 4 5 6 
B. 0 2 4 6 8 
C. 0 2 4 6 
D. 0 2 4 
20. What is the difference between ‘Exception’ and ‘error’ in Java? [CLO1] 
A. Exception class is used for exceptional conditions that user program should catch. 
B. Error defines exceptions that are not excepted to be caught by the program. 
C. Exception and Error are the subclasses of the Throwable class. 
D. All of the above. 
public class Test { public static void main(String[] args) { double radius; final double PI= 3.15169; double area = radius * radius * PI; System.out.println("Area is " + area); } } 
int count = 0; 
while ( count <= 6 ) 
{ 
System.out.print( count + " " ); 
count = count + 2; 
} 
System.out.println( );
CONFIDENTIAL FP301 OBJECT ORIENTED PROGRAMMING 
Page 7 of 17 
21. The following are keywords in exception handling except [CLO1] 
A. try 
B. finally 
C. caught 
D. throw 
22. Choose the common exception type [CLO1] 
i. NullPointerException 
ii. NumberFormatException 
iii. SecurityException 
A. i, ii 
B. i, iii 
C. ii, iii 
D. i, ii, iii 
23. Which is TRUE about assertion? [CLO1] 
A. Assertion is a mechanism used by many programming languages to describe what to do when something unexpected happen. 
B. Assertion is a way to test some assumption about the logic of a program. 
C. Assertion is a part of the program and cannot be removed independently from the program. 
D. All of the above. 
24. What does exception type in the following program throw? [CLO2] 
A. ArithmeticException 
B. ArrayIndexOutOfBoundsException 
C. StringIndexOutOfBoundsException 
D. ClassCastException 
public class Test { public static void main(String[] args) { int[] list = new int[5]; System.out.println(list[5]); } }
CONFIDENTIAL FP301 OBJECT ORIENTED PROGRAMMING 
Page 8 of 17 
25. Given the following code: 
Which could be used to create an appropriate catch block? [CLO2] 
A. ClassCastException 
B. IllegalStateException 
C. NumberFormatException 
D. IllegalArgumentException 
26. What will be the output of the following program? [CLO3] 
A. finally 
exception 
finished 
B. exception 
finished 
C. finally 
D. Compilation fails 
try { int x = Integer.parseInt(“two”); } 
public class Test { 
public static void aMethod() throws Exception { 
try { 
throw new Exception(); 
} finally { 
System.out.println(“finally”); 
} 
public static void main(String args[]) { 
try { 
aMethod(); 
} catch (Exception e) { 
System.out.println(“exception”); 
} 
System.out.println(“finished”) 
} 
}
CONFIDENTIAL FP301 OBJECT ORIENTED PROGRAMMING 
Page 9 of 17 
27. What will be the result of compiling and running the program below? [CLO3] 
A. Run time error 
B. Compile time error 
C. Program compiles correctly and print “A” when executed 
D. Program compiles correctly and prints “A” and “C” when executed 
28. Which methods can access a private attribute? [CLO1] 
A. Only classes in the same package. 
B. Only static methods in the same class. 
C. Only those defined in the same class. 
D. Only instance methods in the same class. 
29. Which of the following is the general scheme for a class definition? [CLO1] 
A. Class ClassName { 
// Description of the instance variables. 
// Description of the constructors. 
// Description of the methods.} 
B. class ClassName { 
// Description of the instance variables. 
// Description of the constructors. 
// Description of the methods.} 
C. ClassName { 
// Description of the instance variables. 
// Description of the constructors. 
// Description of the methods.} 
D. class ClassName { }; 
public class Exception { 
public static void main(String[] args){ 
System.out.println(“A”); 
try{} 
catch(java.io.IOException t) { 
System.out.println(“B”); 
} 
} 
}
CONFIDENTIAL FP301 OBJECT ORIENTED PROGRAMMING 
Page 10 of 17 
30. average = calculate (no1, no2, no3) 
What is the type of parameter passing based on the above coding. [CLO1] 
A. Call by value 
B. Call by object 
C. Call by parameter 
D. Call waiting 
31. If a method assigns a new value to a member of an object which can be accessed through an object reference parameter, will this have any effect on its caller? 
[CLO1] 
A. No, because it only has a copy of the object. 
B. No, because it does not allow to do this. 
C. Yes, this will change part of the object that both it and the caller are referring to. 
D. Yes, the caller will now get a new object. 
32. Which one of Java packages below is used for basic language functionality and fundamentals types? [CLO1] 
A. java.lang 
B. java.util 
C. java.math 
D. java.io 
33. A constructor ________ [CLO1] 
A. must have the same name as the class it is declared within 
B. is used to create objects 
C. maybe declared private 
D. all of the above
CONFIDENTIAL FP301 OBJECT ORIENTED PROGRAMMING 
Page 11 of 17 
34. A String class _________________________________________ [CLO1] 
i. is final 
ii. is public 
iii. is serializable 
iv. has a constructor which takes a StringBuffer objects as an arguments 
A. i only 
B. i, ii 
C. i, ii, iii 
D. All of the above 
35. Which of the following is a correct syntax for defining a new class Cupboard based on the superclass Furniture? [CLO 2] 
A. class Cupboard isa Furniture { //additional definitions go here } 
B. class Cupboard implements Furniture { //additional definitions go here } 
C. class Cupboard defines Furniture { //additional definitions go here } 
D. class Cupboard extends Furniture { //additional definitions go here } 
36. Which three lines of codes are equivalent to line 3? [CLO 2] 
i. final int k = 4; 
ii. public int k = 4; 
iii. static int k = 4; 
iv. abstract int k = 4; 
A. i, ii, iii 
B. ii, iii, iv 
C. i, iii,iv 
D. All of the above 
public interface Foo 
{ 
int k = 4; /* Line 3 */ 
}
CONFIDENTIAL FP301 OBJECT ORIENTED PROGRAMMING 
Page 12 of 17 
37. What is the output of the following segment program? 
[CLO 2] 
A. fa fa 
B. fa la 
C. la la 
D. Compilation fails 
38. Consider the following coding 
[CLO 2] 
What is the output? 
A. 6 
B. river 
C. 8 
D. Columbia 
39. Which of the following defines a legal abstract class? 
[CLO 3] 
A. abstract class Vehicle { abstract void display(); } 
B. class Vehicle { abstract void display(); } 
C. abstract Vehicle { abstract void display(); } 
D. class abstract Vehicle { abstract void display(); } 
public class Tenor extends Singer { 
public static String sing(){ return “fa”;} 
public static void main(String[] args { 
Tenor t = new Tenor(); 
Singer s = new Tenor(); 
System.out.println(t.sing() + “ “ + s.sing()); 
} 
} 
String river = new String(“Columbia”); 
System.out.println(river.length());
CONFIDENTIAL FP301 OBJECT ORIENTED PROGRAMMING 
Page 13 of 17 
40. Which of the statement, is NOT correct to declare an interface? 
[CLO 3] 
A. 
B. 
C. 
D. 
public interface Marker { 
} 
public interface SomethingIsWrong { 
voidaMethod(intaValue); 
} 
public interface SomethingIsWrong { 
voidaMethod(intaValue) { 
System.out.println("Hi Mom");} 
} 
publicRectanglePlus(Point p, int w, int h) { 
origin = p; 
width = w; 
height = h; 
}
CONFIDENTIAL FP301 OBJECT ORIENTED PROGRAMMING 
Page 14 of 17 
SECTION B 
STRUCTURED QUESTIONS (50 marks) 
INSTRUCTION: 
This section consists of TWO (2) structured questions. Answer ALL questions. 
QUESTION 1 
a. Refer to Figure 1, define source program, Java compiler and Java bytecodes. [CLO1] 
Figure 1 : Program Flow 
(6 marks) 
b. Car is a real world object and it has its own characteristics like colour of the car, model of the car and engine capacity. We can drive the car and stop it. Draw an UML class diagram to show the attributes and the behaviors of a car. [CLO2] 
(7 marks) 
c. Based on your answer in 1(b), write a class definition for class Car by using Java. [CLO3] 
(7 marks) 
d. Write a program to accept a number from the user. Use the assert statement to determine the entered number is within the valid range between 0 and 20. 
[CLO3] 
(5 marks)
CONFIDENTIAL FP301 OBJECT ORIENTED PROGRAMMING 
Page 15 of 17 
QUESTION 2 
a. Explain briefly the operators below: [CLO1] 
i. Conditional operator (2 marks) 
ii. Logical operator (2 marks) 
iii. Left-shift operator (2 marks) 
b. Write a program to get 3 values of array elements from command line with those values in the main() method. Add try and catch block to handle ArrayIndexOutOfBoundsException. [CLO2] 
(5 marks) 
c. Write a command to enable assertion when you run Java program. [CLO2] 
(2 marks)
CONFIDENTIAL FP301 OBJECT ORIENTED PROGRAMMING 
Page 16 of 17 
d. The class Birthday is the parent for the two new classes, YouthBirthday and AdultBirthday. Each of the new classes would ordinarily inherit the greeting() method from Birthday. 
YouthBirthday birthday card for young people. This card will add the line "How you have grown!" to the usual birthday greeting. An AdultBirthday birthday card is for old people. This card will add the line "You haven't changed at all!" to the usual birthday greeting. 
class Birthday { 
int age; 
public Birthday ( String r, int years ) { 
recipient = r; 
age = years; 
} 
public void greeting() { 
System.out.println("Dear " + recipient + ",n"); 
System.out.println("Happy " + age + "th Birthdaynn"); 
} 
} 
Based on the above coding,
CONFIDENTIAL FP301 OBJECT ORIENTED PROGRAMMING 
Page 17 of 17 
i. complete the following definition for class YouthBirthday. [CLO3] 
class ______(a)______ extends ________(b)_______ 
{ 
public ________(c)_______ ( String r, int years ) 
{ 
____________(d)_______ ( r, years ) 
} 
public void greeting() 
{ 
__________(e)___________(); 
System.out.println("How you have grown!!n"); 
} 
} 
(5 marks) 
ii. write a new class definition for AdultBirthday with an overriding method greeting() in it. [CLO3] 
(7 marks)

Mais conteúdo relacionado

Mais procurados

Object+oriented+programming+in+java
Object+oriented+programming+in+javaObject+oriented+programming+in+java
Object+oriented+programming+in+javaYe Win
 
Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org) (usef...
Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org)  (usef...Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org)  (usef...
Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org) (usef...Make Mannan
 
Computer programming mcqs
Computer programming mcqsComputer programming mcqs
Computer programming mcqssaadkhan672
 
Introduction to oop using java
Introduction  to oop using java Introduction  to oop using java
Introduction to oop using java omeed
 
Object Oriented Programming Concepts using Java
Object Oriented Programming Concepts using JavaObject Oriented Programming Concepts using Java
Object Oriented Programming Concepts using JavaGlenn Guden
 
Pemrograman berbasis objek
Pemrograman berbasis objekPemrograman berbasis objek
Pemrograman berbasis objekRika Pertiwi
 
Use Case Diagram
Use Case DiagramUse Case Diagram
Use Case DiagramAshesh R
 
Classes and objects1
Classes and objects1Classes and objects1
Classes and objects1Vineeta Garg
 
Reflection in java
Reflection in javaReflection in java
Reflection in javaupen.rockin
 
C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]Rome468
 
Report of Student management system
Report of Student management systemReport of Student management system
Report of Student management system1amitgupta
 
20.3 Java encapsulation
20.3 Java encapsulation20.3 Java encapsulation
20.3 Java encapsulationIntro C# Book
 

Mais procurados (20)

interface in c#
interface in c#interface in c#
interface in c#
 
Object+oriented+programming+in+java
Object+oriented+programming+in+javaObject+oriented+programming+in+java
Object+oriented+programming+in+java
 
Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org) (usef...
Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org)  (usef...Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org)  (usef...
Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org) (usef...
 
OOPS Basics With Example
OOPS Basics With ExampleOOPS Basics With Example
OOPS Basics With Example
 
Computer programming mcqs
Computer programming mcqsComputer programming mcqs
Computer programming mcqs
 
Introduction to oop using java
Introduction  to oop using java Introduction  to oop using java
Introduction to oop using java
 
Java collections notes
Java collections notesJava collections notes
Java collections notes
 
Object Oriented Programming Concepts using Java
Object Oriented Programming Concepts using JavaObject Oriented Programming Concepts using Java
Object Oriented Programming Concepts using Java
 
OOP C++
OOP C++OOP C++
OOP C++
 
Pemrograman berbasis objek
Pemrograman berbasis objekPemrograman berbasis objek
Pemrograman berbasis objek
 
Use Case Diagram
Use Case DiagramUse Case Diagram
Use Case Diagram
 
Net framework
Net frameworkNet framework
Net framework
 
Classes and objects1
Classes and objects1Classes and objects1
Classes and objects1
 
Reflection in java
Reflection in javaReflection in java
Reflection in java
 
C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]
 
Report of Student management system
Report of Student management systemReport of Student management system
Report of Student management system
 
Class diagrams
Class diagramsClass diagrams
Class diagrams
 
Inheritance In Java
Inheritance In JavaInheritance In Java
Inheritance In Java
 
Abstract data types
Abstract data typesAbstract data types
Abstract data types
 
20.3 Java encapsulation
20.3 Java encapsulation20.3 Java encapsulation
20.3 Java encapsulation
 

Destaque

FINAL PAPER FP501 OPEN SOURCE OPERATING SYSTEM
FINAL PAPER FP501 OPEN SOURCE OPERATING SYSTEMFINAL PAPER FP501 OPEN SOURCE OPERATING SYSTEM
FINAL PAPER FP501 OPEN SOURCE OPERATING SYSTEMAmira Dolce Farhana
 
FP305 data structure PAPER FINAL SEM 3
FP305 data structure PAPER FINAL SEM 3FP305 data structure PAPER FINAL SEM 3
FP305 data structure PAPER FINAL SEM 3Syahriha Ruslan
 
Problem Based Task 1
Problem Based Task 1Problem Based Task 1
Problem Based Task 1rozimm78
 
FP305 data structure june 2012
FP305   data structure june 2012FP305   data structure june 2012
FP305 data structure june 2012Syahriha Ruslan
 
FP 303 COMPUTER NETWORK FINAL PAPER JUNE 2012
FP 303 COMPUTER NETWORK FINAL PAPER JUNE 2012FP 303 COMPUTER NETWORK FINAL PAPER JUNE 2012
FP 303 COMPUTER NETWORK FINAL PAPER JUNE 2012Syahriha Ruslan
 
OBJECT ORIENTED ROGRAMMING With Question And Answer Full
OBJECT ORIENTED ROGRAMMING With Question And Answer  FullOBJECT ORIENTED ROGRAMMING With Question And Answer  Full
OBJECT ORIENTED ROGRAMMING With Question And Answer FullManas Rai
 
Final paper FN511 Switching & Routing
Final paper FN511 Switching & RoutingFinal paper FN511 Switching & Routing
Final paper FN511 Switching & RoutingAmira Dolce Farhana
 
FP 303 COMPUTER NETWORK PAPER FINAL Q
FP 303 COMPUTER NETWORK PAPER FINAL QFP 303 COMPUTER NETWORK PAPER FINAL Q
FP 303 COMPUTER NETWORK PAPER FINAL QSyahriha Ruslan
 
Final exam review answer(networking)
Final exam review answer(networking)Final exam review answer(networking)
Final exam review answer(networking)welcometofacebook
 
FP 303 COMPUTER NETWORK PAPER FINAL
FP 303 COMPUTER NETWORK PAPER FINALFP 303 COMPUTER NETWORK PAPER FINAL
FP 303 COMPUTER NETWORK PAPER FINALSyahriha Ruslan
 
Final paper FN512 server management
Final paper FN512 server managementFinal paper FN512 server management
Final paper FN512 server managementAmira Dolce Farhana
 
OOP Chapter 3: Classes, Objects and Methods
OOP Chapter 3: Classes, Objects and MethodsOOP Chapter 3: Classes, Objects and Methods
OOP Chapter 3: Classes, Objects and MethodsAtit Patumvan
 
Soalan kejuruteraan perisian dan pembangunan sistem
Soalan kejuruteraan perisian dan pembangunan sistemSoalan kejuruteraan perisian dan pembangunan sistem
Soalan kejuruteraan perisian dan pembangunan sistemfafa111283
 
Exercises TCP/IP Networking With Solutions
Exercises TCP/IP Networking With SolutionsExercises TCP/IP Networking With Solutions
Exercises TCP/IP Networking With SolutionsFelipe Suarez
 
Roadmap iDBMS (sebelum ambil alih)
Roadmap iDBMS (sebelum ambil alih)Roadmap iDBMS (sebelum ambil alih)
Roadmap iDBMS (sebelum ambil alih)Kolej Komuniti
 
FINAL PAPER FP304 DATABASE SYSTEM
FINAL PAPER FP304 DATABASE SYSTEMFINAL PAPER FP304 DATABASE SYSTEM
FINAL PAPER FP304 DATABASE SYSTEMAmira Dolce Farhana
 
Data structure-questions
Data structure-questionsData structure-questions
Data structure-questionsShekhar Chander
 

Destaque (20)

FINAL PAPER FP501 OPEN SOURCE OPERATING SYSTEM
FINAL PAPER FP501 OPEN SOURCE OPERATING SYSTEMFINAL PAPER FP501 OPEN SOURCE OPERATING SYSTEM
FINAL PAPER FP501 OPEN SOURCE OPERATING SYSTEM
 
FP305 data structure PAPER FINAL SEM 3
FP305 data structure PAPER FINAL SEM 3FP305 data structure PAPER FINAL SEM 3
FP305 data structure PAPER FINAL SEM 3
 
Problem Based Task 1
Problem Based Task 1Problem Based Task 1
Problem Based Task 1
 
FP305 data structure june 2012
FP305   data structure june 2012FP305   data structure june 2012
FP305 data structure june 2012
 
FP 303 COMPUTER NETWORK FINAL PAPER JUNE 2012
FP 303 COMPUTER NETWORK FINAL PAPER JUNE 2012FP 303 COMPUTER NETWORK FINAL PAPER JUNE 2012
FP 303 COMPUTER NETWORK FINAL PAPER JUNE 2012
 
OBJECT ORIENTED ROGRAMMING With Question And Answer Full
OBJECT ORIENTED ROGRAMMING With Question And Answer  FullOBJECT ORIENTED ROGRAMMING With Question And Answer  Full
OBJECT ORIENTED ROGRAMMING With Question And Answer Full
 
FP305 data structure
FP305     data structure FP305     data structure
FP305 data structure
 
Final paper FN511 Switching & Routing
Final paper FN511 Switching & RoutingFinal paper FN511 Switching & Routing
Final paper FN511 Switching & Routing
 
FP 303 COMPUTER NETWORK PAPER FINAL Q
FP 303 COMPUTER NETWORK PAPER FINAL QFP 303 COMPUTER NETWORK PAPER FINAL Q
FP 303 COMPUTER NETWORK PAPER FINAL Q
 
Final exam review answer(networking)
Final exam review answer(networking)Final exam review answer(networking)
Final exam review answer(networking)
 
FP 303 COMPUTER NETWORK PAPER FINAL
FP 303 COMPUTER NETWORK PAPER FINALFP 303 COMPUTER NETWORK PAPER FINAL
FP 303 COMPUTER NETWORK PAPER FINAL
 
Final paper FN512 server management
Final paper FN512 server managementFinal paper FN512 server management
Final paper FN512 server management
 
problem based task oop
problem based task oopproblem based task oop
problem based task oop
 
OOP Chapter 3: Classes, Objects and Methods
OOP Chapter 3: Classes, Objects and MethodsOOP Chapter 3: Classes, Objects and Methods
OOP Chapter 3: Classes, Objects and Methods
 
Soalan kejuruteraan perisian dan pembangunan sistem
Soalan kejuruteraan perisian dan pembangunan sistemSoalan kejuruteraan perisian dan pembangunan sistem
Soalan kejuruteraan perisian dan pembangunan sistem
 
Exercises TCP/IP Networking With Solutions
Exercises TCP/IP Networking With SolutionsExercises TCP/IP Networking With Solutions
Exercises TCP/IP Networking With Solutions
 
Roadmap iDBMS (sebelum ambil alih)
Roadmap iDBMS (sebelum ambil alih)Roadmap iDBMS (sebelum ambil alih)
Roadmap iDBMS (sebelum ambil alih)
 
Data Structures (BE)
Data Structures (BE)Data Structures (BE)
Data Structures (BE)
 
FINAL PAPER FP304 DATABASE SYSTEM
FINAL PAPER FP304 DATABASE SYSTEMFINAL PAPER FP304 DATABASE SYSTEM
FINAL PAPER FP304 DATABASE SYSTEM
 
Data structure-questions
Data structure-questionsData structure-questions
Data structure-questions
 

Semelhante a FP 301 OOP FINAL PAPER JUNE 2013

Name _______________________________ Class time __________.docx
Name _______________________________    Class time __________.docxName _______________________________    Class time __________.docx
Name _______________________________ Class time __________.docxrosemarybdodson23141
 
Kality CS Model_Exit_Exams_with_answer - Copy (2).doc
Kality CS Model_Exit_Exams_with_answer - Copy (2).docKality CS Model_Exit_Exams_with_answer - Copy (2).doc
Kality CS Model_Exit_Exams_with_answer - Copy (2).docAnimutGeremew3
 
classes object fgfhdfgfdgfgfgfgfdoop.pptx
classes object  fgfhdfgfdgfgfgfgfdoop.pptxclasses object  fgfhdfgfdgfgfgfgfdoop.pptx
classes object fgfhdfgfdgfgfgfgfdoop.pptxarjun431527
 
Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...
Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...
Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...Udayan Khattry
 
Module wise format oops questions
Module wise format oops questionsModule wise format oops questions
Module wise format oops questionsSANTOSH RATH
 
17432 object oriented programming
17432   object oriented programming17432   object oriented programming
17432 object oriented programmingsoni_nits
 
C# programming constructors
C# programming  constructorsC# programming  constructors
C# programming constructors성진 원
 
Oop suplemnertary september 2019
Oop suplemnertary september  2019Oop suplemnertary september  2019
Oop suplemnertary september 2019ktuonlinenotes
 
Technical aptitude Test 1 CSE
Technical aptitude Test 1 CSETechnical aptitude Test 1 CSE
Technical aptitude Test 1 CSESujata Regoti
 
Technical aptitude test 2 CSE
Technical aptitude test 2 CSETechnical aptitude test 2 CSE
Technical aptitude test 2 CSESujata Regoti
 
200 mcq c++(Ankit dubey)
200 mcq c++(Ankit dubey)200 mcq c++(Ankit dubey)
200 mcq c++(Ankit dubey)Ankit Dubey
 
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2Knowledge Center Computer
 
Question Paper Code 065 informatic Practice New CBSE - 2021
Question Paper Code 065 informatic Practice New CBSE - 2021 Question Paper Code 065 informatic Practice New CBSE - 2021
Question Paper Code 065 informatic Practice New CBSE - 2021 FarhanAhmade
 
Object Oriented Programming - Constructors & Destructors
Object Oriented Programming - Constructors & DestructorsObject Oriented Programming - Constructors & Destructors
Object Oriented Programming - Constructors & DestructorsDudy Ali
 
C# Tutorial MSM_Murach chapter-15-slides
C# Tutorial MSM_Murach chapter-15-slidesC# Tutorial MSM_Murach chapter-15-slides
C# Tutorial MSM_Murach chapter-15-slidesSami Mut
 
U19CS101 - PPS Unit 4 PPT (1).ppt
U19CS101 - PPS Unit 4 PPT (1).pptU19CS101 - PPS Unit 4 PPT (1).ppt
U19CS101 - PPS Unit 4 PPT (1).pptManivannan837728
 
Bis 311 final examination answers
Bis 311 final examination answersBis 311 final examination answers
Bis 311 final examination answersRandalHoffman
 
Oop r&amp;s may 2019 (2)
Oop r&amp;s may 2019 (2)Oop r&amp;s may 2019 (2)
Oop r&amp;s may 2019 (2)ktuonlinenotes
 

Semelhante a FP 301 OOP FINAL PAPER JUNE 2013 (20)

Name _______________________________ Class time __________.docx
Name _______________________________    Class time __________.docxName _______________________________    Class time __________.docx
Name _______________________________ Class time __________.docx
 
Part - 2 Cpp programming Solved MCQ
Part - 2  Cpp programming Solved MCQ Part - 2  Cpp programming Solved MCQ
Part - 2 Cpp programming Solved MCQ
 
Kality CS Model_Exit_Exams_with_answer - Copy (2).doc
Kality CS Model_Exit_Exams_with_answer - Copy (2).docKality CS Model_Exit_Exams_with_answer - Copy (2).doc
Kality CS Model_Exit_Exams_with_answer - Copy (2).doc
 
Java Quiz
Java QuizJava Quiz
Java Quiz
 
classes object fgfhdfgfdgfgfgfgfdoop.pptx
classes object  fgfhdfgfdgfgfgfgfdoop.pptxclasses object  fgfhdfgfdgfgfgfgfdoop.pptx
classes object fgfhdfgfdgfgfgfgfdoop.pptx
 
Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...
Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...
Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...
 
Module wise format oops questions
Module wise format oops questionsModule wise format oops questions
Module wise format oops questions
 
17432 object oriented programming
17432   object oriented programming17432   object oriented programming
17432 object oriented programming
 
C# programming constructors
C# programming  constructorsC# programming  constructors
C# programming constructors
 
Oop suplemnertary september 2019
Oop suplemnertary september  2019Oop suplemnertary september  2019
Oop suplemnertary september 2019
 
Technical aptitude Test 1 CSE
Technical aptitude Test 1 CSETechnical aptitude Test 1 CSE
Technical aptitude Test 1 CSE
 
Technical aptitude test 2 CSE
Technical aptitude test 2 CSETechnical aptitude test 2 CSE
Technical aptitude test 2 CSE
 
200 mcq c++(Ankit dubey)
200 mcq c++(Ankit dubey)200 mcq c++(Ankit dubey)
200 mcq c++(Ankit dubey)
 
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
 
Question Paper Code 065 informatic Practice New CBSE - 2021
Question Paper Code 065 informatic Practice New CBSE - 2021 Question Paper Code 065 informatic Practice New CBSE - 2021
Question Paper Code 065 informatic Practice New CBSE - 2021
 
Object Oriented Programming - Constructors & Destructors
Object Oriented Programming - Constructors & DestructorsObject Oriented Programming - Constructors & Destructors
Object Oriented Programming - Constructors & Destructors
 
C# Tutorial MSM_Murach chapter-15-slides
C# Tutorial MSM_Murach chapter-15-slidesC# Tutorial MSM_Murach chapter-15-slides
C# Tutorial MSM_Murach chapter-15-slides
 
U19CS101 - PPS Unit 4 PPT (1).ppt
U19CS101 - PPS Unit 4 PPT (1).pptU19CS101 - PPS Unit 4 PPT (1).ppt
U19CS101 - PPS Unit 4 PPT (1).ppt
 
Bis 311 final examination answers
Bis 311 final examination answersBis 311 final examination answers
Bis 311 final examination answers
 
Oop r&amp;s may 2019 (2)
Oop r&amp;s may 2019 (2)Oop r&amp;s may 2019 (2)
Oop r&amp;s may 2019 (2)
 

Último

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 

Último (20)

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 

FP 301 OOP FINAL PAPER JUNE 2013

  • 1. EXAMINATION AND EVALUATION DIVISION DEPARTMENT OF POLYTECHNIC EDUCATION (MINISTRY OF HIGHER EDUCATION) INFORMATION & COMMUNICATION TECHNOLOGY (ICT) DEPARTMENT FINAL EXAMINATION JUNE 2012 SESSION FP301: OBJECT ORIENTED PROGRAMMING DATE: 21 NOVEMBER 2012 (WEDNESDAY) DURATION: 2 HOURS (2.30PM-4.30PM) This paper consists of SEVENTEEN (17) pages including the front page. Section A: Objective (40 questions – answer ALL) Section B: Structure (2 questions – answer ALL). CONFIDENTIAL DO NOT OPEN THIS QUESTION PAPER UNTIL INSTRUCTED BY THE CHIEF INVIGILATOR (The CLO stated is for reference only)
  • 2. CONFIDENTIAL FP301 OBJECT ORIENTED PROGRAMMING Page 2 of 17 SECTION A OBJECTIVE QUESTIONS (50 marks) INSTRUCTION: This section consists of FORTY (40) objective questions. Answer ALL questions in the answer booklet. 1. UML is the acronym of _________________________ [CLO1] A. Unification Multi Language B. Unify Multimedia Language C. United Modeling Language D. Unified Modeling Language 2. Which of the following terminologies is used to describe the data component in UML class diagram. [CLO1] A. Attribute B. Method C. Object D. Class 3. Which of the following define the best statement of object oriented analysis? [CLO1] A. The process of defining the problem in terms of real-world objects with which the system must interact B. The process of defining the components, interfaces, objects, classes, attributes, and operations that will satisfy the requirements C. The process of defining the problem, scenario, and operations that will satisfy the requirements D. The process of defining the components, interfaces, objects, classes, attributes, and operations which the system must interact 4. Which of the following statements is correct? [CLO1] A. Every class must end with a semicolon. B. Every comment line must end with a semicolon. C. Every line in a program must end with a semicolon. D. Every statement in a program must end with a semicolon
  • 3. CONFIDENTIAL FP301 OBJECT ORIENTED PROGRAMMING Page 3 of 17 5. What is byte code in the context of Java? [CLO1] A. It is the code written within the instance methods of a class. B. The type of code generated by a Java Virtual Machine. C. The type of code generated by a Java compiler. D. It is another name for a Java source file. 6. Select the best description about data type. [CLO1] A. The part of the CPU that does arithmetic. B. A part of main memory used to store data. C. The collection of variables that a program uses. D. A particular scheme for representing values with bit patterns. 7. Why is main() method special in a Java program? [CLO1] A. It is where the Java interpreter starts the whole program running. B. Only the main() method may create objects. C. Every class must have a main() method. D. The main() method must be the only static method in a program. 8. The act of creating an object of given class is called ___________ [CLO1] A. Declaration B. Referencing C. Instantiation D. Implementation 9. Which one of the following illustrates proper naming convention in Java programming style? [CLO1] A. int StudentName; B. final double MAXVALUE = 3.547; C. public class compute_Area(){} D. public static int ReadDouble(){}
  • 4. CONFIDENTIAL FP301 OBJECT ORIENTED PROGRAMMING Page 4 of 17 10. What value will be the result if you attempt to add an int, a byte, a long and a double? [CLO1] A. byte B. int C. long D. Double 11. Which of the following statements correctly creates an input stream by user input? [CLO1] A. BufferedReader kb = new InputStreamReader(System.in); B. BufferedReader kb = new BufferedReader( ); C. BufferedReader kb = new BufferedReader(InputStreamReader(System.in)); D. BufferedReader kb = new BufferedReader (new InputStreamReader (System.in)); 12. This operator performs an arithmetic or signed right shift. Which of the following is the symbol of the operator? [CLO1] A. >> B. >>> C. << D. <<< 13. Which of the following statements is correct to display Welcome to Java?[CLO2] A. System.out.println('Welcome to Java'); B. System.out.println("Welcome to Java"); C. System.println('Welcome to Java'); D. System.print('Welcome to Java'); 14. Given a java class as follows: In order to compile this program, the source code should be stored in a file _____ [CLO2] A. Test.class B. Test.java C. Test.doc D. Test.txt public class Test {}
  • 5. CONFIDENTIAL FP301 OBJECT ORIENTED PROGRAMMING Page 5 of 17 15. Consider the following code snippet: What would you write in order to instantiate MyClass? [CLO2] A. MyClass mc = new MyClass(); B. MyClass mc = new MyClass; C. MyClass mc = MyClass(); D. MyClass mc = MyClass; 16. Which will legally declare, construct, and initialize an array? [CLO2] A. int [] myList = {"1", "2", "3"}; B. int [] myList = (5, 8, 2); C. int myList [] [] = {4,9,7,0}; D. int myList [] = {4, 3, 7}; 17. What are the three parts of a counting loop that must be coordinated in order for the loop to work properly? [CLO2] A. Initializing the condition, changing the condition, terminating the loop. B. Initializing the counter, testing the counter, changing the counter. C. The while statement, the if statement, and sequential execution. D. The while, the assignment, and the loop body. public class MyClass{ public MyClass() { /*code*/ } }
  • 6. CONFIDENTIAL FP301 OBJECT ORIENTED PROGRAMMING Page 6 of 17 18. Analyze the following code: Select the best statement that describes the program [CLO3] A. The program has compile errors because the variable radius is not initialized. B. The program has a compile error because a constant PI is defined inside a method. C. The program has no compile errors but will get a runtime error because radius is not initialized. D. The program compiles and runs fine. 19. Examine the following code: What is the output? [CLO3] A. 1 2 3 4 5 6 B. 0 2 4 6 8 C. 0 2 4 6 D. 0 2 4 20. What is the difference between ‘Exception’ and ‘error’ in Java? [CLO1] A. Exception class is used for exceptional conditions that user program should catch. B. Error defines exceptions that are not excepted to be caught by the program. C. Exception and Error are the subclasses of the Throwable class. D. All of the above. public class Test { public static void main(String[] args) { double radius; final double PI= 3.15169; double area = radius * radius * PI; System.out.println("Area is " + area); } } int count = 0; while ( count <= 6 ) { System.out.print( count + " " ); count = count + 2; } System.out.println( );
  • 7. CONFIDENTIAL FP301 OBJECT ORIENTED PROGRAMMING Page 7 of 17 21. The following are keywords in exception handling except [CLO1] A. try B. finally C. caught D. throw 22. Choose the common exception type [CLO1] i. NullPointerException ii. NumberFormatException iii. SecurityException A. i, ii B. i, iii C. ii, iii D. i, ii, iii 23. Which is TRUE about assertion? [CLO1] A. Assertion is a mechanism used by many programming languages to describe what to do when something unexpected happen. B. Assertion is a way to test some assumption about the logic of a program. C. Assertion is a part of the program and cannot be removed independently from the program. D. All of the above. 24. What does exception type in the following program throw? [CLO2] A. ArithmeticException B. ArrayIndexOutOfBoundsException C. StringIndexOutOfBoundsException D. ClassCastException public class Test { public static void main(String[] args) { int[] list = new int[5]; System.out.println(list[5]); } }
  • 8. CONFIDENTIAL FP301 OBJECT ORIENTED PROGRAMMING Page 8 of 17 25. Given the following code: Which could be used to create an appropriate catch block? [CLO2] A. ClassCastException B. IllegalStateException C. NumberFormatException D. IllegalArgumentException 26. What will be the output of the following program? [CLO3] A. finally exception finished B. exception finished C. finally D. Compilation fails try { int x = Integer.parseInt(“two”); } public class Test { public static void aMethod() throws Exception { try { throw new Exception(); } finally { System.out.println(“finally”); } public static void main(String args[]) { try { aMethod(); } catch (Exception e) { System.out.println(“exception”); } System.out.println(“finished”) } }
  • 9. CONFIDENTIAL FP301 OBJECT ORIENTED PROGRAMMING Page 9 of 17 27. What will be the result of compiling and running the program below? [CLO3] A. Run time error B. Compile time error C. Program compiles correctly and print “A” when executed D. Program compiles correctly and prints “A” and “C” when executed 28. Which methods can access a private attribute? [CLO1] A. Only classes in the same package. B. Only static methods in the same class. C. Only those defined in the same class. D. Only instance methods in the same class. 29. Which of the following is the general scheme for a class definition? [CLO1] A. Class ClassName { // Description of the instance variables. // Description of the constructors. // Description of the methods.} B. class ClassName { // Description of the instance variables. // Description of the constructors. // Description of the methods.} C. ClassName { // Description of the instance variables. // Description of the constructors. // Description of the methods.} D. class ClassName { }; public class Exception { public static void main(String[] args){ System.out.println(“A”); try{} catch(java.io.IOException t) { System.out.println(“B”); } } }
  • 10. CONFIDENTIAL FP301 OBJECT ORIENTED PROGRAMMING Page 10 of 17 30. average = calculate (no1, no2, no3) What is the type of parameter passing based on the above coding. [CLO1] A. Call by value B. Call by object C. Call by parameter D. Call waiting 31. If a method assigns a new value to a member of an object which can be accessed through an object reference parameter, will this have any effect on its caller? [CLO1] A. No, because it only has a copy of the object. B. No, because it does not allow to do this. C. Yes, this will change part of the object that both it and the caller are referring to. D. Yes, the caller will now get a new object. 32. Which one of Java packages below is used for basic language functionality and fundamentals types? [CLO1] A. java.lang B. java.util C. java.math D. java.io 33. A constructor ________ [CLO1] A. must have the same name as the class it is declared within B. is used to create objects C. maybe declared private D. all of the above
  • 11. CONFIDENTIAL FP301 OBJECT ORIENTED PROGRAMMING Page 11 of 17 34. A String class _________________________________________ [CLO1] i. is final ii. is public iii. is serializable iv. has a constructor which takes a StringBuffer objects as an arguments A. i only B. i, ii C. i, ii, iii D. All of the above 35. Which of the following is a correct syntax for defining a new class Cupboard based on the superclass Furniture? [CLO 2] A. class Cupboard isa Furniture { //additional definitions go here } B. class Cupboard implements Furniture { //additional definitions go here } C. class Cupboard defines Furniture { //additional definitions go here } D. class Cupboard extends Furniture { //additional definitions go here } 36. Which three lines of codes are equivalent to line 3? [CLO 2] i. final int k = 4; ii. public int k = 4; iii. static int k = 4; iv. abstract int k = 4; A. i, ii, iii B. ii, iii, iv C. i, iii,iv D. All of the above public interface Foo { int k = 4; /* Line 3 */ }
  • 12. CONFIDENTIAL FP301 OBJECT ORIENTED PROGRAMMING Page 12 of 17 37. What is the output of the following segment program? [CLO 2] A. fa fa B. fa la C. la la D. Compilation fails 38. Consider the following coding [CLO 2] What is the output? A. 6 B. river C. 8 D. Columbia 39. Which of the following defines a legal abstract class? [CLO 3] A. abstract class Vehicle { abstract void display(); } B. class Vehicle { abstract void display(); } C. abstract Vehicle { abstract void display(); } D. class abstract Vehicle { abstract void display(); } public class Tenor extends Singer { public static String sing(){ return “fa”;} public static void main(String[] args { Tenor t = new Tenor(); Singer s = new Tenor(); System.out.println(t.sing() + “ “ + s.sing()); } } String river = new String(“Columbia”); System.out.println(river.length());
  • 13. CONFIDENTIAL FP301 OBJECT ORIENTED PROGRAMMING Page 13 of 17 40. Which of the statement, is NOT correct to declare an interface? [CLO 3] A. B. C. D. public interface Marker { } public interface SomethingIsWrong { voidaMethod(intaValue); } public interface SomethingIsWrong { voidaMethod(intaValue) { System.out.println("Hi Mom");} } publicRectanglePlus(Point p, int w, int h) { origin = p; width = w; height = h; }
  • 14. CONFIDENTIAL FP301 OBJECT ORIENTED PROGRAMMING Page 14 of 17 SECTION B STRUCTURED QUESTIONS (50 marks) INSTRUCTION: This section consists of TWO (2) structured questions. Answer ALL questions. QUESTION 1 a. Refer to Figure 1, define source program, Java compiler and Java bytecodes. [CLO1] Figure 1 : Program Flow (6 marks) b. Car is a real world object and it has its own characteristics like colour of the car, model of the car and engine capacity. We can drive the car and stop it. Draw an UML class diagram to show the attributes and the behaviors of a car. [CLO2] (7 marks) c. Based on your answer in 1(b), write a class definition for class Car by using Java. [CLO3] (7 marks) d. Write a program to accept a number from the user. Use the assert statement to determine the entered number is within the valid range between 0 and 20. [CLO3] (5 marks)
  • 15. CONFIDENTIAL FP301 OBJECT ORIENTED PROGRAMMING Page 15 of 17 QUESTION 2 a. Explain briefly the operators below: [CLO1] i. Conditional operator (2 marks) ii. Logical operator (2 marks) iii. Left-shift operator (2 marks) b. Write a program to get 3 values of array elements from command line with those values in the main() method. Add try and catch block to handle ArrayIndexOutOfBoundsException. [CLO2] (5 marks) c. Write a command to enable assertion when you run Java program. [CLO2] (2 marks)
  • 16. CONFIDENTIAL FP301 OBJECT ORIENTED PROGRAMMING Page 16 of 17 d. The class Birthday is the parent for the two new classes, YouthBirthday and AdultBirthday. Each of the new classes would ordinarily inherit the greeting() method from Birthday. YouthBirthday birthday card for young people. This card will add the line "How you have grown!" to the usual birthday greeting. An AdultBirthday birthday card is for old people. This card will add the line "You haven't changed at all!" to the usual birthday greeting. class Birthday { int age; public Birthday ( String r, int years ) { recipient = r; age = years; } public void greeting() { System.out.println("Dear " + recipient + ",n"); System.out.println("Happy " + age + "th Birthdaynn"); } } Based on the above coding,
  • 17. CONFIDENTIAL FP301 OBJECT ORIENTED PROGRAMMING Page 17 of 17 i. complete the following definition for class YouthBirthday. [CLO3] class ______(a)______ extends ________(b)_______ { public ________(c)_______ ( String r, int years ) { ____________(d)_______ ( r, years ) } public void greeting() { __________(e)___________(); System.out.println("How you have grown!!n"); } } (5 marks) ii. write a new class definition for AdultBirthday with an overriding method greeting() in it. [CLO3] (7 marks)