GAT Subject :: All Aptitude Test ::

Hassan
1.Software that can be used in applications other than the one for which it was originally written is called
A. recyclable
B. inherited
C. reusable
D. recyclable

2.When the compiler cannot differentiate between two overloaded constructors, they are called______
A. overloaded
B. destructed
C. ambiguous
D. overloaded

3.A function that is prototyped as double calculate(int num); may______
A. receive an integer constant such as 5
B. receive an integer variable
C. either (a) or (b)
D. receive an integer constant such as 5

4.Passing a variable pointer as a constant _____
A. protects the contents pointed to by the pointer from change
B. eliminates the need to name the pointer in the function
C. eliminates the need to give the pointer a type in the function
D. protects the contents pointed to by the pointer from change

5.Recursive Functions
A. easier to code
B. executable faster than iterative ones
C. takes less main storage space
D. easier to code

6.The purpose of a conditional operator is to
A. select one of the two values
B. select the highest of the two values
C. select one of the two values depending on a condition
D. select one of the two values

7.Which of the following, if any, are valid names for variables?
A. amt.Sold
B. amt-Sold
C. amt_Sold
D. amt.Sold

8.A class hierarchy
A. describes "is a kind of" relationships
B. describes "has a" relationships
C. shows the same relationships as an organization chart
D. describes "is a kind of" relationships

9.Which of the following C++ expressions is equivalent to the mathematical expression 53 ?
A. 5 ^ 3
B. cube(5)
C. pow (3, 5)
D. 5 ^ 3

10.The right shift operator is represented by the symbol
A.
B. >> 
C. ->
D.

11.In C++, class definitions are most often
A. stored with each program that uses them
B. stored in a header file that is included in the programs that use them
C. stored in a folder that you paste into every new project
D. stored with each program that uses them

12.To execute a C++ program, you first need to translate the source code into object code. This process is called
A. coding
B. compiling
C. sourcing
D. coding

13.The rules of a programming language are called its _____
A. code
B. guidelines
C. procedures
D. code

14.An array element is accessed using
A. a first-in-first-out approach
B. the dot operator
C. a member name
D. a first-in-first-out approach

15.The program can access the private members of a class
A. directly
B. only through other private members of the class
C. only through other public members of the class
D. directly

16.To hide a data member from the program, you must declare the data member in the _____ section of the class
A. concealed
B. confidential
C. hidden
D. concealed

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

18.The function whose prototype is void getData(Item *thing); receives
A. a pointer to a structure
B. a reference to a structure
C. a copy of a structure
D. a pointer to a structure

19.You may override the class access specifier for_____
A. public members
B. public and protected members
C. any specific class members you choose
D. public members

20.The null character needs a space of
A. zero bytes
B. one byte
C. three bytes
D. zero bytes

21.The number of structures than can be declared in a single statement is
A. one
B. two
C. three
D. one

22.The cout << sales[0] + sales[1]; statement will______
A. display 22000
B. display 10000 + 12000
C. display sales[0] + sales[l]
D. display 22000

23.The most efficient data type for a variable that stores the letter C is the _____ data type
A. Character
B. Double
C. Float
D. Character

24.The C++ operator used to allocate memory is _________
A. mem
B. allocate
C. new
D. mem

25.Assume that your version of C++ can recognize only the first 8 characters of an identifier name, through identifier names may be arbitrarily long. Which of the following identifier names is not distinct:
A. list, list2
B. address, Address
C. identifier_l, identifier_2
D. list, list2

26.Object is to class as _____
A. library is to book
B. mother is to daughter
C. Plato is to philosopher
D. library is to book

27.A derived class may also be called a
A. subclass
B. super class
C. parent class
D. subclass

28.The C++ keyword for declaring a variable that contains a decimal point is _____
A. dec
B. decimal
C. float
D. dec

29.When you define an object that is a member of a class, such as Student Abby; _____
A. a block of memory is set aside and all data members are assigned valid values
B. a block of memory is set aside
C. no memory is set aside until values are defined
D. a block of memory is set aside and all data members are assigned valid values

30.A program can directly access the _____ members of a class
A. hidden
B. private
C. public
D. hidden


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