Tuesday, January 12, 2010

c++part4

UNIT IV- Files and Streams,polymorphism and virtual function


One mark questions:

1. A ____ is a general name given to a flow of data.
a. bits b. stream c. Both a & b d. None

2. Each stream is associated with a ______.
a. Object b. class c. Both d. None

3. ____ is base class for all the iostreams.
a. Object b. iostream c. ios d. None

4. _______ is a technique that allows the user considerable flexibles in the way programs are
used.
a. Overloading b. redirection c. Both d.Overriding

5. Each file in C++ is an object of a ________
a. stream class b. bits class c. abstract d. None

6. ____ means existing in effect but not in reality.
a. abstract b. virtual c. Both d. None

7. _______ are used when invoking a program from DOS.
a. command line arguments b. parameters c. instructions d. None

8. _____ class includes all functions for input of data.
a. ofstream b. ifstream c. stream d. None

9. _____ class includes functions for output of data.
a. ofstream b. ifstream c. stream d. None

10. For working with files _____ header file is included.
a. stream.h b. fstream.h c. Both d. None

11. fstream.h incorporates _______ header file.
a. stream.h b. graphics.h c. iostream.h d. None

12. ______ are those files created by storing a block of memory.
a. ASCII b. binary c. non-ASCII d. Both b & c

13. ___ are those files created by storing each character.
a. ASCII b. binary c. non- ASCII d. None

14. The opening of files is automatically done by ____.
a. constructor b. initialiser c. Both d. None

15. EOF stands for ___
a. end of fstream b. end of file c. extra out file d. None

16. The ___ method of fstream class can open the file for reading/writing binary or text file.
a. constructor b. open( ) c. Both d. None

17. The parameters to read( ) are an pointer to the block and ____.
a. filename b. sizeof the block c. Both d. None

18. Each file object is associated with two integer values called ______
a. get pointer, put pointer b. show pointer, write pointer c. read, write d. None

19. The pointers specify the ____ number in the file.
a. byte b. bit c. file number d. None

20. The ____ functions are not part of the class but yet can access the private members of the
class.
a. virtual b. static c. friend d. None

21. Static polymorphism is also said to be ______ time polymorphism
a. compile b. interpreting c. run d. None

22. Dynamic polymorphism is also said to be ___ time Polymorphism
a. compile b. interpreting c. run d. None

23. Dynamic polymorphism is also said to be ____ binding
a. early b. late c. Both d. None

24. Static polymorphism is also said to be ___ binding
a. early b. late c. Both d. None

25. catch( ) is called as __________.
a.. exception handler b. throwing exception c. Both d. None


Answer – 1 Marks
1. b 2. b 3. c 4.b 5.a 6.b 7.a 8.b 9.a
10.b 11.c 12.d 13.a 14.a 15.b 16.b 17.b 18.a
19.a 20.c 21.a 22.c 23.b 24.a 25.a