Join Us ::
Register
Login
Home
Classes
GK
Engineering
Past Papers
Current Affairs
Technical
GAT Subject
Programming
Medical Papers
728by90ad
GAT Subject
Computer Science
English Mcqs
Agriculture
Botany Mcqs
Arithmetic Aptitude
Engineering
Computer Science
Civil Engineering
Chemical Engineering
Agricultural Engineering
Mechanical Engineering
Electronics and Communication
Technical
Networking
Electronics
Database
Past Papers
Model Papers
FPSC Papers
PPSC Papers
NTS Papers
General Knowledge
Basic General Knowledge
General Science
Pakistan Politics
International Organizations
Current Affairs
Pakistan
National
International
CPEC
Engineering
Computer Science
Civil Engineering
Chemical Engineering
Agricultural Engineering
Programming
C Programming
C++ Programming
C# Programming
Java Programming
Computer Science :: All Aptitude Test ::
Home
»
GAT Subject
»
Computer Science
» Aptitude Test - 15
1.
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
2.
Which of the following operators may be overloaded?
A.
.(Member)
B.
::(scope resolution)
C.
%(Modulus)
D.
.(Member)
3.
When you overload operators, you may change:
A.
associativity
B.
precedence
C.
binary operators to unary ones
D.
associativity
4.
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
5.
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)
6.
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
7.
Assume num = 8; the value of expression num++ is:
A.
7
B.
8
C.
9
D.
7
8.
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
9.
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
10.
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.
11.
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
12.
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
13.
To write an object to a disk file, which of the following can be used ?
A.
get
B.
write ()
C.
out()
D.
get
14.
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
15.
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
16.
A function that is called automatically each time an object is created is a (n):
A.
contractor
B.
constructor
C.
builder
D.
contractor
17.
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
18.
A constructor always has:
A.
communication cohesion
B.
temporal cohesion
C.
logical cohesion
D.
communication cohesion
19.
When the compiler cannot differentiate between two overloaded constructors, they are called:
A.
overloaded
B.
destructed
C.
ambiguous
D.
overloaded
20.
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
21.
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
22.
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
23.
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))
24.
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.
25.
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)
26.
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;
27.
Which of the following concepts make extensive use of arrays?
A.
Binary trees
B.
Scheduling of processes
C.
Caching
D.
Binary trees
28.
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
29.
Which of the following is not possible with an array in C programming language ?
A.
Declaration
B.
Definition
C.
Dynamic Allocation
D.
Declaration
30.
Index of arrays in C programming language starts from?
A.
0
B.
1
C.
either 0 or 1
D.
0
Related Subjects
Programming Fundamentals
Object Oriented Programming
Discrete Structures
Data Structures and Algorithms
Digital Logic Design
Operating Systems
Database Systems
Artificial Intelligence
Computer Hardware
Management Information Systems
Disk Operating System (DOS)
System Analysis and Design
Unix Questions
Automation System
Linux Questions
Electronic Principles
Windows NT
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