All mock tests are FREE till 31 December — register to save your progress
Paper 2 CS · UNIT 03

Programming Languages and Computer Graphics – Previous Year Questions

229 questions from past UGC NET Paper 2 – Computer Science papers, each with the correct answer. Open any question for its explanation.

  1. Match List I (programming paradigms) with List II (characteristics). List I: A. Imperative, B. Object-oriented, C. Logic, D. Functional. List II: I. Declarative, clausal representation, theorem proving, II. Side-effect-…
    Answer: A. A ‐ IV, B ‐ III, C ‐ I, D ‐ II Paper 2 CS · November 2021
  2. Suppose you have eight black-and-white images taken with a 1-megapixel camera and one 8-colour image taken with an 8-megapixel camera. How much hard disk space in total do you need to store these images?
    Answer: B. 4 MB Paper 2 CS · November 2021
  3. Which of the statements given below are correct? The midpoint (or Bresenham) algorithm for rasterizing lines is optimized relative to DDA algorithm in that A. it avoids round‐off operations. B. it is incremental. C. it…
    Answer: D. A, B, and C only M Paper 2 CS · November 2021
  4. What is the transformation matrix that transforms the square with vertices (1, 1), (−1, 1), (−1, −1), (1, −1) into the parallelogram with corresponding vertices (2, 1), (0, 1), (−2, −1), (0, −1)?
    Answer: A. M = [1 1 0; 0 1 0; 0 0 1] Paper 2 CS · November 2021
  5. A Bezier curve P(t) is defined by four control points P0 = (−2, 0), P1 = (−2, 4), P2 = (2, 4), P3 = (2, 0). Which statements are correct? A. P(t) has degree 3. B. P(1/2) = (0, 3). C. The curve may extend outside the con…
    Answer: A. A and B only Paper 2 CS · November 2021
  6. Given below are two statements Statement I: The maximum number of sides that a triangle might have when clipped to a rectangular viewport is 6. Statement II: In 3D graphics, the perspective transformation is nonlinear i…
    Answer: D. Statement I is false but Statement II is true Paper 2 CS · November 2021
  7. With 1-byte chars, 2-byte shorts, 4-byte ints and 8-byte doubles, each aligned to its size, no field reordering, and padding for alignment, how much space does this array use? struct { short s; char c; short t; char d;…
    Answer: C. 240 bytes Paper 2 CS · November 2020
  8. Consider the Java function: public static float f(long m, long n) { float result = (float)m / (float)n; if (m < 0 || n < 0) return 0.0f; else result -= f(m * 2, n * 3); return result; } Which value best approximates f(1…
    Answer: A. 0.2 Paper 2 CS · November 2020
  9. In the context of 3D Computer graphics, which of the following statements is/are correct? (A) Under perspective projection, each set of parallel lines in the object do not stay parallel in the image (except those that a…
    Answer: A. (A) and (B) only Paper 2 CS · November 2020
  10. Concerning phong shading and Gouraud shading in a 3D scene, which of the following statements are true? (A) Gouraud shading requires more computation than phong shading. (B) Gouraud shading linearly interpolates the col…
    Answer: C. (B) and (C) only Paper 2 CS · November 2020
  11. Match List-I with List-II. List I gives matrices representing 2D transformations and List-II shows the corresponding transformation diagrams.
    Answer: D. A-II, B-IV, C-III, D-I Paper 2 CS · November 2020
  12. Given below are different properties of 3D projections from A-D. Identify the correct order on the basis of property true of (i) a perspective projection only, (ii) an orthographic projection only, (iii) both orthograph…
    Answer: C. D, C, A, B Paper 2 CS · November 2020
  13. Given below are two statements: Statement I : Bezier curves are curves that interpolate all of their control points. Statement II : A cubic bezier curve has four control points. In the light of the above statements, cho…
    Answer: D. Statement I is incorrect but Statement II is true. Paper 2 CS · November 2020
  14. What is the output? int i, j, x = 0; for (i = 0; i < 5; ++i) for (j = 0; j < i; ++j) { x += (i + j − 1); break; } printf("%d", x);
    Answer: A. 6 Paper 2 CS · December 2019
  15. Let A be the base class in C ++ and B be the derived class from A with protected inheritance. Which of the following statement is false for class B?
    Answer: D. Object of derived class B can access public base class data Paper 2 CS · December 2019
  16. A rectangle is bounded by x = 0, y = 0, x = 5 and y = 3. The segment joining (−1, 0) and (4, 5), clipped against this window, connects the points
    Answer: B. (0, 1) and (2, 3) Paper 2 CS · December 2019
  17. Which of the following algorithms is not used for line clipping?
    Answer: B. Southerland-Hodgeman algorithm Paper 2 CS · December 2019
  18. 1024 × 768 If we want to resize a pixels image to one that is 640 pixels wide with the same aspect ratio, what would be the height of the resized image?
    Answer: C. 480 Pixels Paper 2 CS · December 2019
  19. Java Virtual Machine (JVM) is used to execute architectural neutral byte code. Which of the following is needed by the JVM for execution of Java Code?
    Answer: B. Class loader and Java Interpreter Paper 2 CS · December 2019
  20. Consider the following statements with respect to approaches to fill areas on raster systems : P: To determine the overlap intervals for scan lines that cross the area. Q: To start from a given interior position and pai…
    Answer: C. Both P and Q Paper 2 CS · December 2019
  21. Which of the following statements are true regarding C ++ ? (a) Overloading gives the capability to an existing operator to operate on other data types. (b) Inheritance in object oriented programming provides support to…
    Answer: C. (a), (b) and (d) only Paper 2 CS · December 2019
  22. Which of the following are legal C statements? (a) int *P = &44; (b) int *P = &r; (c) int P = &a; (d) int P = a;
    Answer: C. (b) and (d) Paper 2 CS · December 2019
  23. On a 32-bit x86 machine: typedef struct { union { unsigned char a; unsigned short b; } U; unsigned char c; } S; S B[10]; S *p = &B[4]; S *q = &B[5]; p->U.b = 0x1234; (S takes 32 bits). If M is q − p and N is (int)&(p->c…
    Answer: C. (1, 2) Paper 2 CS · June 2019
  24. Class Good has a field m and a method public boolean equals(Good n) { return n.m == m; }. In main: Good m1 = new Good(22), m2 = new Good(22); Object s1 = new Good(22), s2 = new Good(22); then it prints m1.equals(m2), s1…
    Answer: D. True, False, False, False C + + f( Paper 2 CS · June 2019
  25. Consider the following function ) : f n unsigned int (unsigned int )( b = 0 unsigned int ; while (n) { b+ = n&1 ; n ≫>= 1 ; } return b;} ``` f ( The function ) returns the int that represents _P_ the in the binary repre…
    Answer: D. number of 1's Paper 2 CS · June 2019
  26. Consider a raster system with resolution 640 by 480 . What size is frame buffer (in bytes) for this system to store 12 bits per pixel?
    Answer: A. 450 kilobytes Paper 2 CS · June 2019
  27. Consider the following statements regarding 2D transforms in computer graphics: 1 0 [ ] 2 × 2 S1 : is a matrix that reflects 0 −1 2D X (mirrors) only point about the -axis. 2 × 2 2D S2 : A matrix which mirrors any point…
    Answer: B. Only S1 is true Paper 2 CS · June 2019
  28. In the context of 3D computer graphics, which of the following statements is/are true? P : Orthographic transformations keep parallel lines parallel. Q : Orthographic transformations are affine transformations. Select t…
    Answer: A. Both P and Q Paper 2 CS · June 2019
  29. Using the phong reflectance model, the strength of the specular highlight is determined by the angle between
    Answer: D. the reflected vector and the view vector Paper 2 CS · June 2019
  30. If the frame buffer has 10-bits per pixel and 8- bits are allocated for each of the R, G, and B components, then what would be the size of the color lookup table (LUT) ?
    Answer: D. (2¹⁰ + 2¹¹) bytes Paper 2 CS · December 2018