Tuesday, January 12, 2010

c++part3

UNIT III- Templates, Pointers and Graphics
One mark questions:

1. ____ is a variable that holds the address of a data item.
a. reference b. pointers c. Both a& b d. None

2.Graphics mode require a graphics monitor and _______.
a. CGA b. EGA c. VGA d. All

3. To include a user-defined header file you use ____.
a. “ “ b. < > c. Both d. None

4. Templates are also known as ___________.
a. abstract data types b. Parameterized data types c. Both a & b d. None

5. When the class derives another class, ______ template is written for derived class.
a. different b. same c. Cannot be done d. None

6.Addresses are basically starting with _______
a. 0 b. 1 c. –1 d. None

7.If 640K memory then ___ is max address.
a. 0 b. 65535 c. 65534 d. 65536

8. _______ operator is used to allocate memory.
a. malloc( ) b. new c. Both a & b d. None

9. ______ operator is used to deallocate memory
a. free ( ) b. delete c. Both d. None

10. At the ___________ data structure is concerned with the actual storage location of data and
the relationship of different data items.
a. Physical level b. Logical level c. Both d. None

11. At the ____ data structure is concerned with the defined data relationships.
a. Physical level b. Logical level c. Both d. None

12. Data structures have _______ levels.
a. 1 b. 2 c. 4 d. 0

13. Inside the class, we can create _____ of its own type but we cannot create ___ of its own
type.
a. Object, Pointer b. Pointer, Object c. array, object d. None

14. How do you declare array of pointers.
a. *p b. (*p)[2] c. *p[2] d. None

15. How do you declare pointer to pointers.
a. **p b. (*p)[2] c. *p[2] d. None

16. What is the meaning of **p ____
a. the address of a pointer is a pointer to a integer
b. the address of a pointer is a pointer to a pointer c. Not available d. None

17. ____ function erases the text window.
a. clrscr( ) b. cleardevice( ) c. Both d. None

18. _____ header file is included for working with graphics.
a. stdio.h b. graphics.h c. windows.h d. None

19. _____ function positions the cursor within the text window.
a. move( ) b. gotoxy( ) c.moveto( ) d. None

20. _____ function releases the memory of graphics system.
a. close ( ) b. closegraph( ) c. Both a & b d. None

21. ____ function fills a bounded region with color.
a. setcolor( ) b. floodfill c. fillcolor( ) d. None

22. The viewports arguments are given in _____ coordinates
a. absolute screen b. graphics c. Cartesian d. None

23. If the value of the setviewport “clip” argument is set to ___, then all drawings will be clipped
the current viewport.
a. 0 b. non- zero c. Both d. None



Answers
One mark
1. b 11.b 21.b
2. d 12.b 22.a
3. a 13.b 23.b
4.b 14.c
5.a 15.a
6.a 16.b
7.b 17.a
8.b 18.b
9.b 19.b
10.a 20.a