U.G.C. NET Exam. 24 June, 2019 Paper–II (COMPUTER SCIENCE & APPLICATIONS)

Total Questions: 100

21. Answer the following question


Correct Answer: (b)
Solution:

This pseudo code basically represents the exponentiation algorithm. With p as the base and n as the power and the final result is stored in m.

22. Consider the following C-code fragment running on a 32-bit x86 machine :

Correct Answer: (c) (1, 2)
Solution:

In this, size of short int = 4 bytes
S * p = & B [4]; // p is having the address of B [4]
S * q = & B [5]; // q is having the address of B [5]
suppose B[4] address is 116 [take base address as 100].
So B [5] will come as 120
q – p will be = (address of B[5] – address of B[4])
q – p = (120 – 116)/4 = 4/4 = 1
Also M is equal to q – p (given in the question)
So M = 1
Now, we have to find the value of N =
((int) & (p → c)) – ((int) p),
Here, c is a char and it is type casted to int ((int) & (P
→ C)) – ((int) p // address difference between p's
starting address and c address will be of 2 bytes only.
So N becomes 2
∴ (M, N) = (1, 2)

23. What is the output of the following JAVA program?


Correct Answer: (d) True, False, False, False
Solution:

24. Answer the following question

Correct Answer: (d) number of 1
Solution:

b + = n & 1;
binary AND operation and then add result with b consider n as 5;
So binary representation of n is 101
initially b = 0
B + = n & 1; // It means b = 0 + 101
& 001; b = 0 + convert to decimal (001);
b = 1 n >> // n is right shifted to 1 so,
n becomes 010
b + = n & 1;
this gives b = 1 + 010 & 001; b = 1 + 0; b = 1
Again, n is right shifted; n becomes 001
b + = n & 1; // b = 1 + 001 & 001;
b = 1 + 1 = 2
Again, n is right shifted n becomes 000 while (n) //It becomes false program will return the final value of b; which is 2. Which is equal to the number of 1's in the binary representation of n.

25. Which of the following statements is/are true?

P : In a scripting language like JavaScript, types are typically associated with values, not variables.
Q : It is not possible to show images on a web page without the  tag of HTML.
Select the correct answer from the options given below :

Correct Answer: (a) P only
Solution:

P → In a scripting language like Java script, types are typically associated with values, not variables. Java script is a client side as well as server-side scripting language. Java Script data types are : number, string, Boolean, object undefined. Basically, the type of
a value determines the operations and methods performed or it. Variables are not directly associated with any particular type; any variable can be assigned values of all type. Images can be shown on a web page without the use of image tag of HTML. We can use div by giving the URL of the image in that.

26. Which of the following statements is/are true?

Correct Answer: (a) P and Q only
Solution:

XML - XML stands for extensible markup language It is a meta markup language for text documents/data. It allows to define language to represent text. It is designed to describe data not to display data. XML tags are not predefined.
Some points in XML are as follows :
* An XML document is well formed it. Satisfies rule specified by the W 3C.
* A well - formed XML have a proper starting and closing tag.
* An XML documented validated against a DTD is both "Well formed" and "valid"
* Purpose of DTD is to define the structure and legal elements and attributed of a XML     document.
* XML does not require DTD.
* XML carries the data; it does not represent it.
* XML can be used for off loading and reloading of database.
XML declaration syntax is :
<?Xml version = "1.0"
encoding = "UTF – 8"?

27. 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?

Correct Answer: (a) 450 kilobytes
Solution:

Raster scan system : In this electron beam move on the screen from top to bottom covering each row one by one.
Explanation : Given resolution of the system is : 640 × 480 we have to store 12 bits per pixel. Frame buffer size = resolution (number of pixels) x number of bits per pixel
Frame buffer size = (640 × 480) × 12
= 3686400 bits
convert it into bytes.
frame buffer size = 3686400/8 = 460800 Byte
= 450 K

28. Consider the following statement regarding 2D transforms in computer graphics :

Correct Answer: (b) Only S1 is true
Solution:

First matrix is reflection matrix about x-axis S₁ is true always.

29. 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 the correct answer from the options given below:

Correct Answer: (a) Both P and Q
Solution:

orthogonal projections are parallel projection Each line that is originally parallel will be parallel after this transformation-
orthographic projection (sometimes referred to as orthogonal projection, used to be called analemma is a means of representing three dimensional objects in two dimensions. It is a form of parallel projection, in which all the projection lines are orthogonal which to the projection plane.
In Euclidean geometry, an affine transformation or an affinity (from the Latin, affini's, connected with is a geometric transformation that preserve lines and parallelism (but not necessarily distance and angles). The orthographic projection can be represent by a affine transformation.

30. Using the phong reflectance model, the strength of the specular highlight is determined by the angle between

Correct Answer: (d) the reflected vector and the view vector
Solution:

Phong reflectance model :
* It is local illumination model. In real world, light is shown with the help of its spectrum. In computer graphics, light color is made of a triplet that is of three colours RGB(red, green and blue).
* The reflectance spectrum is a triple of percent the light seen on a surface can be divided into four components such as : emissive component, ambient component, diffusive component, specula component. Specular component :
This component shows the reflected light in a specific direction. It reflects on the basis of reflection of incident light. The special light depends on the position of observer with respect to the surface.
Specular component finds the strength which is the multiplication of specular surface constant with specular intensity and with dot product of reflection direction and the direction of surface towards the view. It means it is determined by the angle between reflected and view vector.