UGC NET Computer Science Solved Questions December 2013 Paper 3 - Part 2

11.       Match the following style rules for reusability:
a. Keep methods coherent
b. Keep methods small
c. Keep methods consistent
d. Provide uniform coverage
i. Write a method to get the last element of a list.
ii. Maintain parallel structure when possible.
iii. Breaking a method into smaller parts.
iv. Perform a single function or a group of closely related functions.
      a   b   c  d
(A) iv  iii   ii   i
(B) ii   i    iv  iii
(C) iii  iv  ii    i
(D) ii  iii   iv   i
Answer: A
12.       Which is the protocol for performing RPCs between applications in a language and system independent way?
(A) Hyper Text Transmission Protocol (HTTP)
(B) Simple Network Management Protocol (SNMP)
(C) Simple Object Access Protocol (SOAP)
(D) Simple Mail Transfer Protocol (SMTP)
Answer: C
SOAP (Simple Object Access Protocol), which is based in Extensible Markup Language (XML), facilitates communication between application and operating systems.
It is a messaging protocol that allows programs that run on disparate operating systems (such as Windows and Linux) to communicate using Hypertext Transfer Protocol (HTTP) and its Extensible Markup Language (XML).
13.       The document that is used by XSLT to indicate, how to transform the elements of the XML document to another format is
(A) HTML page
(B) DOC type procedure
(C) Style sheet
(D) Stored procedure
Answer: C
14.       Which of the following concepts means adding new concepts to a program as it runs?
(A) Data hiding
(B) Dynamic loading
(C) Dynamic typing
(D) Dynamic binding
Answer: B
In OOPs Dynamic Binding refers to linking a procedure call to the code that will be executed only at run time. The code associated with the procedure is not known until the program is executed, which is also known as late binding.
Dynamic loading is a mechanism by which a computer program can, at run time, load a library into memory, retrieve the addresses of functions and variables contained in the library, execute those functions or access those variables, and unload the library from memory. Unlike static linking and load time linking, this mechanism allows a computer program to startup in the absence of these libraries, to discover available libraries, and to potentially gain additional functionality.
15.       Which of the following correctly describes overloading of functions?
(A) Virtual polymorphism
(B) Transient polymorphism
(C) Ad-hoc polymorphism
(D) Pseudo polymorphism
Answer: C
16.       Match the following with respect to programming languages:
a. Structured Language
b. Non-structured Language
c. Object oriented Programming Language
d. Interpreted Programming Language
      a  b   c   d
(A) iii  iv   i   ii
(B) iv  iii  ii   i
(C) ii  iv   i   iii
(D) ii  iii   iv  i
Answer: A
17.       The compiler converts all operands upto the type of the largest operand is called
(A) Type Promotion
(B) Type Evaluation
(C) Type Conversion
(D) Type Declaration
Answer: A
18.       C++ actually supports the following two complete dynamic allocation systems:
(A) One defined by C++ and the other not defined by C.
(B) One defined by C and one specific to C++.
(C) Both are specific to C++
(D) Both of them are improvements of C.
Answer: B
19.       Important advantage of using new and delete operation in C++ is
(A) Allocation of memory
(B) Frees the memory previously allocated
(C) Initialization of memory easily
(D) Allocation of memory and frees the memory previously allocated.
Answer: D
20.    Match the following control strategies of prolog:
a. Forward movement
b. Unification
c. Deep backtracking 
d. Shallow backtracking
i. Variable can be done with a constant, another variable or a function
ii. The entire conjunctive goal is executed.
iii. Previous sub goal to find alternative solutions.
iv. Choose sub goal with possible unifier.
      a   b  c   d
(A) iv   i   ii   iii
(B) ii   iv  i    iii
(C) iii  i   iv   ii
(D) ii  iii  iv   i
Answer: A
Prolog Control Strategy
● Prolog contains three basic control strategies.
− Forward movement
− Matching (Unification)
− Backward movement (Backtracking)
● Prolog uses depth first search strategy.

Forward Movement
● Choose a rule by
− searching sequentially in the program from top to bottom whose head matches with the goal with possible unifier.
− Remember the position of the matched rule.
− Join the rule body in front of the sequence of sub goals to be solved.
● Repeat until either goal is satisfied or is failed.

● Unification is a process of matching or finding the most general unifier.
− Constant matches with the same constant.
− A variable can match with any constant or any another variable.

● Backtracking refers to backtrack in search process for a solution.
● In Prolog, backtracking takes place in two situations.
− First when a sub goal fails and
− Other when the last sub goal succeeds, it backtracks to find alternative solutions.

Types of backtracking
● Prolog has two kinds of backtracking.
− Shallow and
− Deep backtracking
● Both backtrackings take place in conjunction with each other.
● Shallow backtracking occurs
− when alternative definition of the goal is tried.

Post a Comment