UGC NET COMPUTER SCIENCE SOLVED PAPERS 2014-16 - UGC NET Computer Science Paper 3 December 2015

26. The context free grammar given by S → XYX X → aX|bX|λ Y → bbb generates the language which is defined by regular expression:

  • Option : C
  • Explanation :
    S → XYX X → aX|bX|λ i.e. (a + b)* Y → bbb S → (a + b)*(bbb)(a + b)* So, option (C) is correct.
Cancel reply
Cancel reply

28. Given the following two languages: L1 = {anban|n > 0} L2 = {an b an bn + 1|n > 0} Which of the following is correct ?

  • Option : A
  • Explanation : Language L1 is context free language as L1 = {anban|n > 0}, we can compare number of a’s before b and number of a’s after b both are equal using only one stack using push and pop function but we can not compare language L2. L2 = {an b an bn + 1|n > 0} using only one stack here we can compare all number of a’s before b and number of a’s after b both are equal using only one stack using push and pop function but we cannot compare all bn + 1 at that time. Hence, L1 is context free language and L2 is not context free language.
Cancel reply
Cancel reply

29. Which of the following is used to make an Abstract class?

  • Option : A
  • Explanation :
    Making atleast one member function as pure virtual function is the method to make abstract class. For more information on Abstract Class Refer:Pure Virtual Functions and Abstract Classes in C++ Option (A) is correct.
Cancel reply
Cancel reply

30. Match the following with reference to object-oriented modeling.

List IList II
(a) Polymorphism(i) Picking both operator and attributes with operations appropriate to model an object
(b) Inheritance(ii) Hiding implementation details of methods from users of objects
(c) Encapsulation(iii) Using similar operations to do similar things
(d) Abstraction(iv) Create new classes from the existing class

Codes:

 (a)(b)(c)(d)
(1)(iv)(iii)(i)(ii)
(2)(iii)(iv)(i)(ii)
(3)(iii)(i)(ii)(iv)
(4)(iv)(iii)(ii)(i)

  • Option : B
  • Explanation :
  • Using similar operations to do similar things is Polymorphism
  • Create new classes from existing class is Inheritence.
  • Picking both operator and attributes with operations appropriate to model an object is encapsulation
  • Hiding implementation details of methods from users of objects is Abstraction
  • So, option (B) is correct.
Cancel reply
Cancel reply