Computer Science :: All Aptitude Test ::

1.An expression contains relational, assignment and arithmetic operators. In the absence of parentheses, the order of evaluation will be
A. assignment, relational, arithmetic
B. arithmetic, relational, assignment
C. relational, arithmetic, assignment
D. assignment, relational, arithmetic

2.The keyword virtual indicates that
A. a derived class has public access to a base class
B. more than one base class exists
C. a base class should be used only once in inheritance
D. a derived class has public access to a base class

3.If you declare two objects as Customer firstCust, secondCust; which of the following must be true?
A. Each object will store a separate copy of any static member data
B. Each object will store a separate copy of any member functions
C. Each object will store a separate copy of any nonstatic data members
D. Each object will store a separate copy of any static member data

4.Variables that are declared in a block are known as _____ variables to that block
A. confined
B. local
C. global
D. confined

5.The pow and sqrt functions return a(n) _____ type number
A. double
B. float
C. integer
D. double

6.Declaring variables is advantageous because it
A. avoids errors from misspelled variable names {b) helps the linker work efficiently
B. simplifies the writing of very short programs
C. All of the above
D. avoids errors from misspelled variable names {b) helps the linker work efficiently

7.The generic name used for unexpected errors that occur during the execution of a program is
A. infractions
B. exceptions
C. d�viations
D. infractions

8.The switch variable can be of
A. int type only
B. char type only
C. both int as well as char type
D. int type only

9.Reference variables and const class members _____
A. must be assigned values in any derived class
B. must never be initialized in a base class
C. must be initialized, rather than assigned values
D. must be assigned values in any derived class

10.You can code a default exception handler by creating a catch block
A. with no arguments
B. with a void argument
C. with an ellipsis as its argument
D. with no arguments

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

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

13.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

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

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

16.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

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

18.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

19.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

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

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

22.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

23.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

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

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

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

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

28.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

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

30.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


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