CS304 1st Quiz Spring 2013

No Comments

Question # 1 of 10 ( Start time: 04:31:59 PM )  Total Marks: 1
Three main characteristics of "Object Oriented programming" are,
 Select correct option:

  Encapsulation,dynamic binding,polymarhpishm
  polymorphism, overloading, overriding
  encapsulation, inheritance, dynamic binding
  encapsulation, inheritance, polymorphism (Correct)
 encapsulation (data and methods that act on the data are encapsulated in a "class")
 inheritance (you can reuse code that has already been created by something very similar)
 polymorphism (using already existing functions to perform new tasks by reusing established code)

 Question # 2 of 10 ( Start time: 04:33:29 PM )  Total Marks: 1
Encapsulation means
 Select correct option:

  Extending the behaviour of class in another class
  Data and behaviour are tightly coupled within an entity (Correct)
  One entity takes all the attributes and operations of the other
  Taking out the common features and put those in a separate class

 Question # 3 of 10 ( Start time: 04:34:53 PM )  Total Marks: 1
Which of the following is an advantage of OOP?
 Select correct option:

  OOP makes it easy to re-use the code
  It provides an ability to create one user defined data type by extending the other
  It provides the facility of defining Abstract data types through which real world entities can be defined    better
All of the given options (Correct)

 Question # 4 of 10 ( Start time: 04:35:59 PM )  Total Marks: 1
We can allocate dynamic memory allocation through___________ key word.
 Select correct option:

  Static
  Global
  New (Correct)
  Const

 Question # 5 of 10 ( Start time: 04:37:31 PM )  Total Marks: 1
In programming, where the actual actions are coded is called:
 Select correct option:

  Function declaration
  Function calling
  Function definition (Correct)
  None of the given

 Question # 6 of 10 ( Start time: 04:38:56 PM )  Total Marks: 1
Which of the following is the way to extract common behaviour and attributes from the given classes and make a separate class of those common behaviours and attributes?
 Select correct option:

  Generalization
  Sub-typing
  Specialization (Correct)
  Extension

 Question # 7 of 10 ( Start time: 04:40:27 PM )  Total Marks: 1
Which of the following is directly related to polymorphism?
 Select correct option:

  Overriding (Correct)
  Const members
  Static members
  None of given

 Question # 8 of 10 ( Start time: 04:41:53 PM )  Total Marks: 1
In a class declaration, data or functions designated private are accessible
 Select correct option:

  to any function in the program.
  only if you know the password.
  to member functions of that class.  (Correct)
  only to public members of the class.

 Question # 9 of 10 ( Start time: 04:43:24 PM )  Total Marks: 1
An instance of user defined type is called
 Select correct option:

  Object (Correct)
  Class
  both of above
  none of above

 Question # 10 of 10 ( Start time: 04:44:52 PM )  Total Marks: 1
Aggregation is implemented using pointer.
 Select correct option:

  True (Correct)
  False



1. Data items in a class must be private.
A.  TRUE
 B.  FALSE  (Correct)


2. The ______ keyword tells the compiler to substitute the code within the function definition for every instance of a function call
 A.  virtual
 B.  inline (Correct)
 C.  instance
 D.  none of the given


3. Objects communicate each other through ________
 A.  Messages (Correct)
 B.  Data members
 C.  Both of above
 D.  None of the above


4. Which one is not the main feature of object oriented programming?
 A.  Classes and Objects
 B.  Exception handling  (Correct)
 C.  Inheritance
 D.  Polymorphism


5. Public member function exposed by a class is called surface
A.  TRUE
 B.  FALSE  (Correct)


6. If class A supports all the operations of class B, then class A is:
 A.  Class A is behaviourally compatible with class B (Correct)
 B.  Class A is behaviourally incompatible with class B
 C.  Class A is independent of class B
 D.  None of the given


7. A fan has wings”. Which type of relation exists between fan and wings in this sentence?
 A.  Aggregation
 B.  Association
 C.  Generalization
 D.  Composition (Correct)


8. Which is true about sub-typing in case of inheritance?
 A.  In sub-typing a new class is derived from existing where the derived class shows some extended  behavior of its parent.  (Correct)
 B.  In sub-typing a new class is derived from existing which is a restricted form of its parent class.
 C.  In sub-typing a class is derived from existing one where the derived class should be abstract.
 D.  None of the given


9. Class is not a mechanism to create objects and define user data types.
A.  TRUE
 B.  FALSE  (Correct)


10. Which of the following may not be an integral part of an object?
 A.  state
 B.  behavior
 C.  Protected data members
 D.  All of given   (Correct)

Next PostNewer Post Previous PostOlder Post Home

0 comments

Post a Comment