GAT Subject :: All Aptitude Test ::

Hassan
1.Which of the following are void functions?
A. main
B. pow
C. sqrt
D. main

2.Hiding individual components of an entry is _____
A. polymorphism
B. encapsulation
C. scaling
D. polymorphism

3.When all of the operations in a function contribute to the performance of only one task, a function has
A. singular cohesion
B. tight cohesion
C. functional cohesion
D. singular cohesion

4.A function that uses variable types is called __________
A. overloaded
B. a template function
C. a variable function
D. overloaded

5.Having more than one function with the same name is called
A. overloading
B. defaulting
C. casting
D. overloading

6.An object is _____
A. a category of classes
B. a name given to a class
C. an instance of a class
D. a category of classes

7.Two access specifers in C++ are
A. public and private
B. int and double
C. formal and informal
D. public and private

8.A data member holds a 1 or 0 depending on whether taxes have been paid. The best identifier for this member is _____
A. taxes
B. paidTaxes
C. taxesArePaid
D. taxes

9.Assume a class Derv that is privately derived from class Base. An object of class Derv located in main() can access
A. public members of Base
B. protected members of Base
C. private members of Base
D. public members of Base

10.Which of the following is an access specifier?
A. particular
B. shielded
C. protected
D. particular

11.Machine code is _____
A. edited code
B. source code
C. the 0s and 1s that the computer can understand
D. edited code

12.The contents of two pointers that point to adjacent of type float differ by
A. one bytes
B. two bytes
C. three bytes
D. one bytes

13.Which of the following is a valid condition for an if statement? (The condition should be both syntactically and logically valid.)
A. (age) > 65
B. (age > 0 and < 10)
C. (sales > 500 && < 800)
D. (age) > 65

14.A pattern for creating an object is called a(n) _____
A. class
B. attributes
C. private
D. class

15.An asterisk placed after a data type means .
A. array to
B. pointer to
C. address to
D. array to

16.An object is a(n) _____ of a class
A. owner
B. function
C. definition
D. owner

17.Which of the following statements creates and initializes a pointer named salesPtr?
A. salesPtr = NULL;
B. *salesPtr = "";
C. float &salesPtr = NULL;
D. salesPtr = NULL;

18.With communicational cohesion
A. a tasks and the data are related
B. the tasks are related; the data are not
C. the data are related; the tasks are not
D. a tasks and the data are related

19.The function printDataMembers() is mot likely a(n) ________
A. inspector functions
B. mutator functions
C. auxiliary functions
D. inspector functions

20.The code class Descendant : virtual public Ancestor indicates that
A. the members of Ancestor will be included more than once in Descendant
B. the members of Ancestor will be included only once in Descendant
C. the members of Descendant will be included more than once in Ancestor
D. the members of Ancestor will be included more than once in Descendant

21.Inheritance is the principle that
A. Classes with the same name must be derived from one another
B. Knowledge of a general category can be applied to more specific objects
C. C++ functions may be used only if they have logical predecessors
D. Classes with the same name must be derived from one another

22.Which of the following formulas can be used to generate random integers between 1 and 10?
A. 1 + rand() % (10 - 1 + 1)
B. 1 + (10 - 1 + 1) % rand()
C. 10 + rand() % (10 - 1 + 1)
D. 1 + rand() % (10 - 1 + 1)

23.Format flags may be combined using the _____
A. bitwise OR operator(|)
B. logical OR operator (||)
C. bitwise AND operator (&)
D. bitwise OR operator(|)

24.Which of the following will store the number 320000 as a Float number?
A. counPop = (float) 3.2e5;
B. counPop = (float) 3.2e6;
C. counPop = (float) .32e5;
D. counPop = (float) 3.2e5;

25.The arguments that determine the state of the cout object are called
A. classes
B. manipulators
C. format flags or state flags
D. classes

26.If a class will serve as a base class, most often the base class data members are
A. private
B. protected
C. public
D. private

27.You can use the C++ _____ function to assign a value to a String variable
A. assign
B. copy
C. string
D. assign

28.A measure of the strength of the connection between two functions is
A. cohesion
B. coupling
C. dependence
D. cohesion

29.The following statement where T is true and F is false T&&T||F&&T
A. is true
B. is false
C. is wrong
D. is true

30.Which of the following statements declares a variable that can contain a decimal number?
A. dec payRate;
B. dec hourlyPay
C. float payRate
D. dec payRate;


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