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

Programming Languages and Computer Graphics — Mock Test 3

25 questions · about 30 minutes. Press End Mock any time to see your score and the correct answers.

0 / 25 answered 00:00
Q1. Statement (I): A friend function and the member functions of a friend class can directly access private and protected data.
Statement (II): A friend function can access private data through the member functions of the base class.
In the light of the above statements, choose the most appropriate answer from the options given below:
Q2. Match List I with List II
List IList II
A. Bezier curvesI. 3-D objects that have translational/rotational symmetry
B. B-SplinesII. Fractal geometry
C. Sweep representationsIII. Bias and tension
D. Natural objectsIV. Painting, drawing, CAD
Q3. What will be the output of the following code?
#include <stdio.h>
int main() {
  int a, b, c;
  a = 0x10; b = 010;
  c = a + b;
  printf("%d", c);
  return 0;
}
Q4. A three-dimensional array in C++ is declared as int A[a][b][c]. Array elements are stored in row-major order and indexing begins from 0. The address of the element A[r][s][t], in terms of the word length w of an integer, is
Q5. What is the output of the following code?
main() {
  struct s1 { char *z; int i; struct s1 *p; };
  static struct s1 a[] = {
    {"Nagpur", 1, a+1},
    {"Raipur", 2, a+2},
    {"Kanpur", 3, a}
  };
  struct s1 *ptr = a;
  printf("%s %s %s\n", a[0].z, ptr->z, a[2].p->z);
}
Q6. The Sutherland-Hodgeman method is used on
Q7. What is x in the following program?
#include <stdio.h>
int main() {
  typedef int (*(*arrfptr[3])())[10];
  arrfptr x;
  return 0;
}
Q8. How will you free the memory allocated by the following program?
#include <stdio.h>
#include <stdlib.h>
#define MAXROW 3
#define MAXCOL 4
int main() {
  int **p, i, j;
  p = (int **) malloc(MAXROW * sizeof(int*));
  return 0;
}
Q9. The clipping process in computer graphics is used for
Q10. Consider the rectangle with vertices (0, 0), (0, 2), (3, 0), (3, 2). It is scaled by 2 along the x-axis and 3 along the y-axis. The new coordinates of the rectangle are
Q11. Which of the following 2-D transformations is used to resize a 2-dimensional object?
Q12. What is the output of the following code?
main() {
  static float a[] = {13.24, 1.5, 4.5, 5.4, 3.5};
  float *j, *k;
  j = a;
  k = a + 4;
  j = j * 2;
  k = k / 2;
  printf("%f %f", *j, *k);
}
Q13. Which of the following is NOT an object-oriented programming language?
Q14. What is the output of the following C program?
#include <stdio.h>
int main(void) {
  int x, *p;
  x = 30;
  p = x;
  printf("%d", *p);
  return 0;
}
Q15. Multiple inheritance is permitted directly in:
A. C++
B. Java
C. Python
D. VB.NET
E. BASIC
Choose the most appropriate answer from the options given below:
Q16. Which of the following are markup languages?
A. HTML
B. XML
C. DHTML
D. LML
E. PML
Choose the correct answer from the options given below:
Q17. Arrange the following in the correct order so that they follow a proper run-time environment.
A. Programming statement
B. Compilation
C. Memory allocation
D. Type of variable
E. Memory deallocation
Choose the correct answer from the options given below:
Q18. Match List I with List II
List IList II
A. UnionI. Virtual Reality
B. FunctionII. Shadow mask
C. Interactive EnvironmentIII. Subroutine
D. Output deviceIV. User-defined data type
Q19. Which of the following algorithms are used for line drawing?
A. DDA algorithm
B. Bresenham algorithm
C. Mid-point algorithm
D. Curve algorithm
Choose the most appropriate answer from the options given below:
Q20. The least values of signed and unsigned 8-bit data-type variables would be:
Q21. In the context of binding, which one of the following is incorrect?
Q22. Given
int arr[3][4][2] = {{{2,4},{7,8},{3,4},{5,6}}, {{7,6},{3,4},{5,3},{2,3}}, {{8,9},{7,2},{3,4},{5,1}}};
Which one of the following can be used to refer to the element 1 in the above 3-D array?
Q23. Allowing different derived classes to be used interchangeably through the interface provided by a common base class is called ______
Q24. In a ______ curve the first and last vertices of the control polygon lie on the curve, and all other vertices define the derivatives, order and shape of the curve.
Q25. Inheritance provides the benefits of
A. Shared interfaces
B. Run-time polymorphism
C. Less redundant information
D. Dynamic binding
Choose the correct answer from the options given below: