Anda di halaman 1dari 3

1. Which of the following is not a legal variable type in C++?

A. long
B. double
C. stack ---right

2. What is binary value of 2510?

A. 110012 ---right
B. 1010110
C. 0010 0101

3. What is the value of decrement 'x' ?

A. The absolute value of x


B. x - 1 ---right
C. The floor value of x

4. How does C++ represent the logical value TRUE?

A. Using the type Boolean


B. Using the constant TRUE
C. Using the integer value 1 ---right

5. Which of the following operations is better performed by an array than a linked list?

A. Sorting the elements


B. Adding an element
C. Accessing a specific element quickly ---right

6. What function does the F3 key perform in C++?

A. Opens a C++ program --- right ans


B. Saves a C++ program
C. None of the above

7. Which of the following is a common use for the directive #define?

A. To avoid including the same source file more than once


B. To assign a descriptive name to a constant value
C. #define is used in all of the above --- right ans

8. What is multiple inheritance?

A. A program that contains more than one instances of inheritance


B. A subclass that inherits more than one base class --- right ans
C. A base class that is inherited by more than one subclasses

9. Under which of the following conditions is a constructor not invoked?

A. When an object goes into scope


B. When an object is passed by value to a function
C. When an object is passed by reference to a function --- right ans
10. What is the relationship between a class and its base class called?

A. The IS_A relationship. --- right ans


B. The BASED relationship.
C. The CLASSED relationship.

11. What is an abstract class?

A. A class with one or more pure virtual member functions --- right ans
B. A class which is used as a template for other classes
C. A class in which all of the member functions are virtual

12. Which of the following is not a- keyword associated with exception processing?

A. catch
B. throw
C. switch --- right ans

13. Which of the following is not an advantage of throwing an exception compared to returning an error?

A. The exception allows a function to indicate that an error has occurred --- right ans
B. All exceptions insure that an error is handled
C. Exception handling can be moved outside of the normal execution flow

14. While of the following prototype functions would be called in the expression 'int n = fun(11.0, "char")?

A. int fun(int, int);


B. int fun(double*, char*);
C. double fun(double, char*); --- right ans

15.which of the following OOPS features is not supported by C++?.

a. polymorphism
b. persistence --- right ans
c. inheritance

16. Which programming style employs an abstraction type called classes and objects?

a. procedure-oriented
b. logic-oriented
c. object-oriented --- right ans

17. ________ allows a single name/operator to be associated with different operations depending on the type of data
passed to

a. polymorphism --- right ans


b. data abstraction
c. decryption

18. ____________ is an atternative to class inheritance and is a way of making object composition as powerful as
inheritance

a. genericity
b. delegation --- right ans
c. multiple inheritance

19. which of these is an example of procedural programming

a. COBOL --- right ans


b. PASCAL
c. C

20. Which of these is not an example of object-oriented programming

a. C --- right ans


b. C++
c. Eiffel

21. Objects mainly serve the purpose of

a. understanding the real world and a practical base for designers.


b. decomposition of a problem into objects depending on nature of the problem.
c. both of the above choices --- right ans

22. _______ is a template that unites data and operations

a. object
b. class --- right ans
c. function

23._________ will permit the construction of reusable software components

a. classes
b. inheritance --- right ans
c. encapsulation

24. C++ supports a mechanism to access a global variable using the 'scope resolution operator'

a. true --- right ans


b. false

25. The syntax of data type casting in C and C++ is the same

a. True
b. false --- right ans

Anda mungkin juga menyukai