Computer Science :: All Aptitude Test ::

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

2.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)

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

4.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;

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

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

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

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

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

10.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;

11.The statement int num[2][3]={ {1,2}, {3,4}, {5, 6} };
A. assigns a value 2 to num[1][2]
B. assigns a value 4 to num[1][2]
C. gives an error message
D. assigns a value 2 to num[1][2]

12.The standard input stream, which refers to the keyboard, is called
A. cin
B. cout
C. stin
D. cin

13.If the code and fee arrays are parallel, the fee that corresponds to the code stored in the code[3] element is located in the _____ element
A. code[2]
B. code[3]
C. fee[2]
D. code[2]

14.Access specifiers are followed by
A. a comma
B. a semicolon
C. a colon
D. a comma

15.Elements in an array are identified by a unique _____
A. data type
B. order
C. subscript
D. data type

16.To include the double quotes as part of the control string we use the symbol
A. %"
B. ""
C. "",#,C D,A C++ statement must end in a,: (column),
D. %"

17.Student senior(); is a(n)_________
A. constructor call with no arguments
B. object instantiation
C. constructor call with all default arguments
D. constructor call with no arguments

18.The statement int n[4] = {11, -13, 17, 105};
A. assigns the value -13 to [2]
B. assigns the value 17 to n[2]
C. is wrong; it gives an error message
D. assigns the value -13 to [2]

19.The part of machine level instruction, which tells the central processor what has to be done, is
A. Operation code
B. Address
C. Locator
D. Operation code

20.Which of the following refers to the associative memory?
A. the address of the data is generated by the CPU
B. the address of the data is supplied by the users
C. there is no need for an address i.e. the data is used as an address
D. the address of the data is generated by the CPU

21.To avoid the race condition, the number of processes that may be simultaneously inside their critical section is
A. 8
B. 1
C. 16
D. 8

22.A system program that combines the separately compiled modules of a program into a form suitable for execution
A. assembler
B. linking loader
C. cross compiler
D. assembler

23.Process is
A. program in High level language kept on disk
B. contents of main memory
C. a program in execution
D. program in High level language kept on disk

24.Addressing structure
A. defines the fundamental method of determining effective operand addresses
B. are variations in the use of fundamental addressing structures, or some associated actions which are related to addressing.
C. performs indicated operations on two fast registers of the machine and leave the result in one of the registers.
D. defines the fundamental method of determining effective operand addresses

25.The Memory Buffer Register (MBR)
A. is a hardware memory device which denotes the location of the current instruction being executed.
B. is a group of electrical circuits (hardware), that performs the intent of instructions fetched from memory.
C. contains the address of the memory location that is to be read from or stored into.
D. is a hardware memory device which denotes the location of the current instruction being executed.

26.The strategy of allowing processes that are logically runnable to be temporarily suspended is called
A. preemptive scheduling
B. non preemptive scheduling
C. shortest job first
D. preemptive scheduling

27.The Storage-to-Storage instructions
A. have both their operands in the main store.
B. which perform an operation on a register operand and an operand which is located in the main store, generally leaving the result in the register, expect in the case of store operation when it is also written into the specified storage location.
C. which perform indicated operations on two fast registers of the machine and have the result in one of the registers
D. have both their operands in the main store.

28.The LRU algorithm
A. pages out pages that have been used recently
B. pages out pages that have not been used recently
C. pages out pages that have been least used recently
D. pages out pages that have been used recently

29.Which of the following systems software does the job of merging the records from two files into one?
A. Security software
B. Utility program
C. Networking software
D. Security software

30.Fork is
A. the dispatching of a task
B. the creation of a new job
C. the creation of a new process
D. the dispatching of a task


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