UGC NET CS 2018 July – II
Question 1 |
The definitions in an XML document are said to be __________ when the tagging system and definitions in the DTD are all in compliance.
well-formed | |
reasonable | |
valid | |
logical |
Discuss it
Question 2 |
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 JavaScript code and D1, D2, ...., D M represents the content displayed in each of the M dialog boxes, then:
M=3; D1 displays ”12”; D2 displays ”6”; D3 displays ”12”. | |
M=3; D1 displays ”6”; D2 displays ”12”; D3 displays ”6”. | |
M=2; D1 displays ”6”; D2 displays ”12”. | |
M=2; D1 displays ”12”; D2 displays ”6”. |
Discuss it
Question 3 |
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.print (P[0] + P[1] + P[2]+”:”); System.out.print (Q[0] + Q[1] + Q[2]); } long [ ] method (long [ ] R) { R [1]=7; return R; } } //end of class
12 : 15 | |
15 : 12 | |
12 : 12 | |
15 : 15 |
Discuss it
Question 3 Explanation:
When above program compliled and run on ide then it will produce 15:15.
IDE link
Option (D) is correct.
Question 4 |
What is the output of the following ‘C’ program ? (Assuming little - endian representation of multi-byte data in which Least Significant Byte (LSB) is stored at the lowest memory address.)
#include <stdio.h> #include <stdlib.h> / * Assume short int occupies two bytes of storage */ int main ( ) { union saving { short int one; char two[2]; }; union saving m; m.two [0] = 5; m.two [1] = 2; printf(’’%d, %d, %dn”, m.two [0], m.two [1], m.one); }/ * end of main * /
5, 2, 1282 | |
5, 2, 52 | |
5, 2, 25 | |
5, 2, 517 |
Discuss it
Question 5 |
Given below are three implementations of the swap( ) function in C++:
(a)
void swap (int a, int b) { int temp; temp = a; a = b; b = temp; } int main( ) { int p = 0, q = 1; swap (p, q); }(b)
void swap (int &a, int &b) { int temp; temp = a; a = b; b = temp; } int main( ) { int p = 0, q = 1; swap (p, q); }(c)
void swap (int * a, int * b) { int * temp; temp = a; a = b; b = temp; } int main( ) { int p = 0, q = 1; swap (&p, &q); }Which of these would actually swap the contents of the two integer variables p and q?
(a) only | |
(b) only | |
(c) only | |
(b) and (c) only |
Discuss it
Question 6 |
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 implement multiple interfaces.
S3 : Java permits a class to replace the implementation of a method that it has inherited. It is called method overloading.
Code:
S1 and S2 only | |
S1 and S3 only | |
S2 and S3 only | |
All of S1, S2 and S3 |
Discuss it
Question 7 |
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.
Code:
P only | |
Q only | |
Both P and Q | |
Neither P nor Q |
Discuss it
Question 7 Explanation:
C programming language has a weak type system with static types but Java programming language has a strong type system with static types.
Both Statements are correct.
So, option (C) is correct.
Question 8 |
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 buffer is approximately :
16 frames per second | |
19 frames per second | |
21 frames per second | |
23 frames per second |
Discuss it
Question 8 Explanation:
Total pixels in the frame buffer = (width x height)= 640 x 480 px = 307200
Here, color depth is 1 bit.
Memory required by frame buffer = Memory required for total pixel =
Total pixels in the frame buffer x (Color depth) = 307200 x 1
If access time for each pixel on the average is 200 ns
Time required to refresh "frame buffer" = Memory required by frame buffer x 200 ns = 61440000 nano second = 61440000 x 10−9 second
Then, refresh rate of frame buffer =
number of frame changes per second = 1 / 61440000 x 10−9 second = 100,00,00,000 / 61440000 = 100,000 / 6144 = 16.2760 = 16 (Approximately)
Question 9 |
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 the screen starting with the most nearest polygon.
S2 : Backface Culling refers to eliminating geometry with backfacing normals.
Code:
S1 only | |
S2 only | |
Both S1 and S2 | |
Neither S1 nor S2 |
Discuss it
Question 10 |
Consider the matrix
M =
representing a set of planar (2D) geometric transformations in homogeneous coordinates. Which of the following statements about the matrix M is True?
M represents first, a scaling of vector (2, 1) followed by translation of vector (1, 1) | |
M represents first, a translation of vector (1, 1) followed by scaling of vector (2, 1) | |
M represents first, a scaling of vector (3, 1) followed by shearing of parameters (−1, 1) | |
M represents first, a shearing of parameters (−1, 1) followed by scaling of vector (3, 1) |
Discuss it
There are 99 questions to complete.