UGC NET · PAPER 2
UGC NET Paper 2 Computer Science – Unit 3: Programming Languages and Computer Graphics PYQ (December 2022 Shift 2)
Q4. Consider the following conditional code, which returns a Boolean value:
if ((x > 25) && (y > 100))
return 'false';
else if ((x <= 25) && (y <= 100))
return 'true';
else if ((x > 25) && (y <= 100))
return 'false';
else
return 'true';Simplify it by filling in the blank with a single Boolean expression without changing the behaviour of the code:if ( ________ )
return 'true';
else
return 'false';- x > 25
- x <= 25
- y > 100
- y <= 100
Q9. Machine level language is a/an
- Assembly Language
- Low-level language
- High-level Language
- Translating Language
Q10. Which of the following is wrong about data types?
- The number is always positive when the qualifier 'unsigned' is used.
- The number can be positive or negative when the qualifier 'signed' is used.
- The range of values for signed data types is more than that of unsigned data types.
- The leftmost bit in an unsigned data type is used to represent the value.
Q11. If a constructor 'Date' is declared explicit and has to be defined outside the class, which of the following is correct?
- Date::Date(int dd) { /* ... */ }
- explicit Date::Date(int dd) { /* ... */ }
- Such a constructor cannot be defined
- A constructor always has to be defined inside the class
Q12. Which one of the following allows the session to continue?
- When a user quits a browser
- When the user logs out and is invalidated by the servlet
- When the session is timed out due to inactivity
- When the user refreshes the browser and there is a persistent cookie
Q46. Given a vector with Cartesian components (x, y), if scaling is done with the matrix [[0.5, 0], [0, 1.5]], which of the following are true?
1. Decreases the vertical by three halves
2. Increases the vertical by three halves
3. Doubles the horizontal
4. Halves the horizontal
Choose the correct answer from the options given below:
1. Decreases the vertical by three halves
2. Increases the vertical by three halves
3. Doubles the horizontal
4. Halves the horizontal
Choose the correct answer from the options given below:
- 1 and 3 only
- 1 and 4 only
- 2 and 3 only
- 2 and 4 only
Q47. Which of the following lists defined in HTML share a similar element?
1. Unordered lists
2. Ordered lists
3. Definition lists
4. Correlated lists
5. Enumerated lists
Choose the most appropriate answer from the options given below:
1. Unordered lists
2. Ordered lists
3. Definition lists
4. Correlated lists
5. Enumerated lists
Choose the most appropriate answer from the options given below:
- 1, 2 only
- 1, 3, 5 only
- 1, 2, 3 only
- 1, 3, 4 only
Q68. Match List I with List II.
Choose the correct answer from the options given below:
Choose the correct answer from the options given below:
| List I | List II |
|---|---|
| a. If the implementation of generated or derived classes differs only through a parameter, we have | I. to use a class hierarchy |
| b. If the actual types of objects used cannot be known at compile time, we have | II. improved run-time efficiency |
| c. If inline operations are essential and templates are used, we have | III. to use templates |
| d. To gain access to differing instances of derived classes through a base, we have | IV. to use explicit casting |
- a-I, b-II, c-IV, d-III
- a-III, b-I, c-II, d-IV
- a-I, b-III, c-II, d-IV
- a-II, b-I, c-III, d-IV
Q78. In what sequence are initialisation, testing and execution of the body done in a do-while loop?
I. Commenting
II. Execution of the body
III. Initialisation
IV. Testing the condition
I. Commenting
II. Execution of the body
III. Initialisation
IV. Testing the condition
- IV, II, III
- IV, III, II
- III, I, II
- III, II, IV
Q87. Assertion A: A raster-scan device is a CRT graphics device and can use a television monitor for display.
Reason R: In a raster-scan display the picture is composed of a series of dots traced out as horizontal lines. Television works in a similar fashion.
Choose the correct answer.
Reason R: In a raster-scan display the picture is composed of a series of dots traced out as horizontal lines. Television works in a similar fashion.
Choose the correct answer.
- Both A and R are true and R is the correct explanation of A
- Both A and R are true but R is not the correct explanation of A
- A is true but R is false
- A is false but R is true