GAT Subject :: All Aptitude Test ::

Hassan
1.If My Class is a friend of Your-Class, which is true?
A. Your Class is a friend of My Class
B. Your Class is not a friend of MY Class
C. Your c!ass may or may not be a friend of My Class
D. Your Class is a friend of My Class

2. Without overloading of the + operator:
A. addition could not be performed on built-in types
B. addition could not be performed on class objectsv
C. class objects could not be added to one another
D. addition could not be performed on built-in types

3.Which of the following operators may be overloaded?
A. .(Member)
B. ::(scope resolution)
C. %(Modulus)
D. .(Member)

4. When you overload operators, you may change:
A. associativity
B. precedence
C. binary operators to unary ones
D. associativity

5.To perform multiple arithmetic operations in a single statement, overloaded operator functions should return:
A. void
B. a copy of the values passed to them
C. an object of the class type
D. void

6.Which of the following is the best function prototype for an overloaded ........... for a Number class?
A. Number operator-(const Number & num)
B. Number & operator-(int num)
C. int Number (operator-())
D. Number operator-(const Number & num)

7. If » operator is overloaded properly for use for input with a number class, and a and bare member of the Number class, which of the following statements allowed?
A. cin >>a
B. cin >> a,b
C. Both (a) and (b)
D. cin >>a

8.Assume num = 8; the value of expression num++ is:
A. 7
B. 8
C. 9
D. 7

9.If ++ operator is overloaded properly, then operator ++ () function returns:
A. a copy of an incremented member of a class
B. a copy of an incremented data item
C. a reference to a class member data item
D. a copy of an incremented member of a class

10.The « operator is used for output only when:
A. it is used as a binary operator
B. it is used as a unary operator
C. cout is to the left
D. it is used as a binary operator

11.Which of the following statements is true?
A. Subscript operator may take only one argument.
B. Parentheses operator may take only one argument
C. Subscript operator may take
D. Subscript operator may take only one argument.

12. A file object can be closed:
A. with the close () function
B. by letting it go out of scope
C. by calling its destructor
D. with the close () function

13. If an array of objects is created, then read () function can work with:
A. one object at a time
B. entire array of objects at once
C. either (a) or (b)
D. one object at a time

14.To write an object to a disk file, which of the following can be used ?
A. get
B. write ()
C. out()
D. get

15.To instantiate an object with the statement ifstream items ("C:inven.txt");, the file on the disk is identified by the name:
A. items
B. inven.txt
C. either (a) or (b)
D. items

16. A class's inherited access is overrided to make an individual member's access, more:
A. conservative
B. liberal
C. either (a) or (b)
D. conservative

17. A function that is called automatically each time an object is created is a (n):
A. contractor
B. constructor
C. builder
D. contractor

18. When an object-oriented program detects an error within a function, the function:
A. catches a message
B. throws a fit
C. throws an exception
D. catches a message

19.A constructor always has:
A. communication cohesion
B. temporal cohesion
C. logical cohesion
D. communication cohesion

20.When the compiler cannot differentiate between two overloaded constructors, they are called:
A. overloaded
B. destructed
C. ambiguous
D. overloaded

21.A mathematical-model with a collection of operations defined on that model is called:
A. Data Structure
B. Abstract Data Type
C. Primitive Data Type
D. Data Structure

22. The information about an array that is used in a program will be stored in:
A. symbol table
B. activation record
C. system table
D. symbol table

23.Which of the following abstract data types can be used to represent a many to many relation?
A. Tree
B. Plex
C. Graph
D. Tree

24. An algorithm is made up of 2 modules M1&M2. If order of M1 is f(n) & M2 is g(n) then the order of algorithm is?
A. max (f(n),g(n))
B. min (f(n),g(n))
C. f(n) + g(n)
D. max (f(n),g(n))

25.An array of n numbers is given, where n is an even number. The maximum as well as the minimum of these n numbers needs to be determined. Which of the following is TRUE about the number of comparisons
A. At least 2n-c comparisons, for some constant c, are needed.
B. At most 1.5n-2 comparisons are needed.
C. At least nlog2n comparisons are needed.
D. At least 2n-c comparisons, for some constant c, are needed.

26.The minimum number of comparisons required to determine if an integer appears more than n/2 times in a sorted array of n integers is:
A. Θ(n)
B. Θ(logn)
C. Θ(log*n)
D. Θ(n)

27.Which of the following is an illegal array definition?
A. Type COLONGE : (LIME, PINE, MUSK, MENTHOL); var a : array [COLONGE] of REAL;
B. var a : array [REAL] of REAL;
C. var a : array [‘A’…’Z’] of REAL;
D. Type COLONGE : (LIME, PINE, MUSK, MENTHOL); var a : array [COLONGE] of REAL;

28.Which of the following concepts make extensive use of arrays?
A. Binary trees
B. Scheduling of processes
C. Caching
D. Binary trees

29.Which of the following operations is not O(1) for an array of sorted data. You may assume that array elements are distinct:
A. Find the ith largest element
B. Delete an element
C. Find the ith smallest element
D. Find the ith largest element

30.Which of the following is not possible with an array in C programming language ?
A. Declaration
B. Definition
C. Dynamic Allocation
D. Declaration


Date to Date Current Affairs 2022

PakMCQs.net

Quick Links

GAT Subject



   Computer Science    English Mcqs    Agriculture    

Engineering



   Computer Science    Civil Engineering    

Technical



   Networking    Electronics    Database    

Past Papers



   Model Papers    FPSC Papers