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.
- Which homogeneous 2D matrix transforms the figure (a) on the left side to the figure (b) on the right ?
- Consider the midpoint (Bresenham) algorithm for rasterizing lines: (1) Input (x₁, y₁) and (x₂, y₂) (2) y = y₁ (3) d = f(x₁ + 1, y₁ + 1/2) // f is the implicit form of the line (4) for x = x₁ to x₂ (5) do (6) plot(x, y)…
- In 3D Graphics, which of the following statements about perspective and parallel projection is/are true? P : In a perspective projection, the farthest an object is from the centre of projection, the smaller it appears.…
- In 3D Graphics, which of the following statements is/are true? P : Back-face culling is an example of an image- precision visible-surface determination procedure. Q : Z-buffer is a 16-bit, 32-bit, or 64-bit field associ…
- Consider the two C++ programs P1 and P2 shown below and two statements about them: S1: P1 prints out 3 S2: P2 prints out 4:2 What can you say about S1 and S2?
- Consider the following recursive Java function f that takes two long arguments and returns a float value : public static float f(long m, long n) { float result =(float )m/(float )n; if (m<0||n<0) return 0.0f ; else resu…
- What does the following Java function perform? (Assume int occupies four bytes of storage) public static int f( int a) { // Pre-conditions : a>0 and no overflow/underflow occurs int b=0 ; for (int i=0; i<32; i++) { b=b<…
- Which of the following HTML5 codes will affect the horizontal as well as vertical alignment of the table content?
- Consider the C/C++ function f() given below: void f(char w[]) { int x = strlen(w); // length of the string char c; for (int i = 0; i < x; i++) { c = w[i]; w[i] = w[x − i − 1]; w[x − i − 1] = c; } } Which of the followin…
- The definitions in an XML document are said to be __________ when the tagging system and definitions in the DTD are all in compliance.
- Consider the JavaScript code: var y = "12"; function f() { var y = "6"; alert(this.y); function g() { alert(y); } g(); } f(); If M is the number of alert dialog boxes generated by this code and D1, D2, …, DM are the con…
- What is the output of the following Java program? class simple { public static void main(String[] args) { simple obj = new simple(); obj.start(); } void start() { long[] P = {3, 4, 5}; long[] Q = method(P); System.out.p…
- What is the output of the following C program? (Assume little-endian representation, with the least significant byte at the lowest address, and a two-byte short int.) #include <stdio.h> int main() { union saving { short…
- Given below are three implementations of swap() in C++: (a) void swap(int a, int b) { int temp; temp = a; a = b; b = temp; } called as swap(p, q); (b) void swap(int &a, int &b) { int temp; temp = a; a = b; b = temp; } c…
- In Java, which of the following statements is/are True ? S1 : The ‘final’ keyword applied to a class definition prevents the class from being extended through derivation. S2 : A class can only inherit one class but can…
- Which of the following statements is/are True ? P : C programming language has a weak type system with static types. Q : Java programming language has a strong type system with static types.
- A graphic display system has a frame buffer that is 640 pixels wide, 480 pixels high and 1 bit of color depth. If the access time for each pixel on the average is 200 nanoseconds, then the refresh rate of this frame buf…
- Which of the following statements is/are True regarding the solution to the visibility problem in 3D graphics ? S1 : The Painter’s algorithm sorts polygons by depth and then paints (scan - converts) each Polygon on to t…
- Consider the matrix M = [2 0 2; 0 1 1; 0 0 1] representing a set of planar (2D) geometric transformations in homogeneous coordinates. Which of the following statements about M is true?