ASoE/Chapter 3/Read MCQs
📖 Back to Study Notes
3

Chapter 3 · MCQ Read Mode

Programming Language and Its Applications

ASOE03·72 Total MCQs
Question 1 of 72Procedure and parallel programming languages

An Abstract Data Type (ADT) is defined primarily by its:

AInternal memory layout
BOperations/behavior, independent of implementation
CProgramming language
DCompiler used
Answer is hidden
Question 2 of 72Procedure and parallel programming languages

Which of the following is NOT one of the three basic structured-programming control structures?

ASequence
BSelection
CIteration
DRecursion
Answer is hidden
Question 3 of 72Procedure and parallel programming languages

The meaning of a syntactically correct statement is called its:

ASyntax
BSemantics
CStructure
DGrammar
Answer is hidden
Question 4 of 72Procedure and parallel programming languages

Every recursive function must have a:

ALoop counter
BBase case
CGlobal variable
DPointer
Answer is hidden
Question 5 of 72Procedure and parallel programming languages

In C, a string is terminated by which character?

ASpace character
BNewline character
CNull character '\0'
DEOF character
Answer is hidden
Question 6 of 72Procedure and parallel programming languages

The RAM model of computation assumes each elementary operation takes:

AO(n) time
BO(log n) time
CA constant amount of time, O(1)
DO(n²) time
Answer is hidden
Question 7 of 72Procedure and parallel programming languages

Which communication method is typical of loosely coupled (distributed) systems?

AShared memory
BMessage passing
CDirect memory access
DSemaphore only
Answer is hidden
Question 8 of 72Procedure and parallel programming languages

A monitor differs from a semaphore mainly because a monitor:

ARequires manual wait()/signal() calls
BAutomatically enforces mutual exclusion around encapsulated shared data
CCannot be used for synchronization
DWorks only in distributed systems
Answer is hidden
Question 9 of 72Procedure and parallel programming languages

The PRAM model assumes multiple processors:

ACommunicate only via message passing
BShare a common memory with unit-time access
CCannot run in parallel
DHave no memory at all
Answer is hidden
Question 10 of 72Procedure and parallel programming languages

A 2-D array element is typically accessed using:

AOne index
BTwo indices
CThree indices
DNo index
Answer is hidden
Question 11 of 72Exception handling in various languages

Which exception type must be declared or handled at compile time in Java?

AUnchecked exception
BChecked exception
CError
DRuntime exception
Answer is hidden
Question 12 of 72Exception handling in various languages

Which block always executes, whether or not an exception was thrown?

Atry
Bcatch
Cthrow
Dfinally
Answer is hidden
Question 13 of 72Exception handling in various languages

Which keyword is used to explicitly raise an exception?

Acatch
Bthrow
Ctry
Dfinally
Answer is hidden
Question 14 of 72Exception handling in various languages

A NullPointerException in Java is an example of a(n):

AChecked exception
BUnchecked (runtime) exception
CCompile-time error
DSyntax error
Answer is hidden
Question 15 of 72Exception handling in various languages

An OutOfMemoryError is typically classified as a(n):

AChecked exception
BUnchecked exception
CError
DEvent
Answer is hidden
Question 16 of 72Exception handling in various languages

In Python, exceptions are handled using try together with which keyword?

Acatch
Bexcept
Crescue
Dhandle
Answer is hidden
Question 17 of 72Exception handling in various languages

Event-driven programming primarily structures code around:

AA fixed sequential order
BResponding to events via handlers/listeners
CRecursive function calls
DOnly database transactions
Answer is hidden
Question 18 of 72Exception handling in various languages

Why is exception handling especially important when working with large databases?

AIt speeds up queries
BIt prevents inconsistent data by allowing safe transaction rollback on failure
CIt removes the need for indexes
DIt replaces the need for a DBMS
Answer is hidden
Question 19 of 72Exception handling in various languages

Which language does NOT provide a built-in 'finally' block (relying instead on RAII for cleanup)?

AJava
BPython
CC++
DC#
Answer is hidden
Question 20 of 72Exception handling in various languages

The try block is used to:

AAlways execute cleanup code
BEnclose code that might throw an exception
CDeclare a new exception type
DTerminate the program immediately
Answer is hidden
Question 21 of 72Pointers, structure and data files in C programming

If ptr is a pointer to int and int size is 4 bytes, what does ptr+1 do?

AMoves ptr forward by 1 byte
BMoves ptr forward by 4 bytes
CMoves ptr backward by 4 bytes
DHas no effect on ptr
Answer is hidden
Question 22 of 72Pointers, structure and data files in C programming

The expression arr[i] is equivalent to which pointer expression?

A*(arr + i)
B&(arr + i)
Carr * i
D(arr + i)
Answer is hidden
Question 23 of 72Pointers, structure and data files in C programming

In a union, how much memory is allocated?

ASum of the sizes of all members
BEqual to the size of the largest member
CEqual to the size of the smallest member
DZero bytes
Answer is hidden
Question 24 of 72Pointers, structure and data files in C programming

Which operator is used to access a structure's member through a pointer to that structure?

A. (dot)
B-> (arrow)
C& (address-of)
D* (dereference only)
Answer is hidden
Question 25 of 72Pointers, structure and data files in C programming

Passing a structure to a function by reference (pointer) is generally preferred for large structures because it:

AAlways changes the structure's type
BAvoids the overhead of copying the entire structure
CIs the only way to pass a structure in C
DMakes the structure read-only
Answer is hidden
Question 26 of 72Pointers, structure and data files in C programming

Which function is used to move the file pointer to a specific position for random access?

Afopen()
Bfscanf()
Cfseek()
Dfclose()
Answer is hidden
Question 27 of 72Pointers, structure and data files in C programming

Which mode opens a file for appending data at its end?

Ar
Bw
Ca
Dr+
Answer is hidden
Question 28 of 72Pointers, structure and data files in C programming

fread() and fwrite() are primarily used for:

AFormatted text I/O
BRaw binary data block I/O
CReading a single character only
DOpening a file
Answer is hidden
Question 29 of 72Pointers, structure and data files in C programming

In C, all members of a structure:

AShare the same memory location
BHave their own separate memory
CCannot be accessed by pointer
DMust be of the same data type
Answer is hidden
Question 30 of 72Pointers, structure and data files in C programming

Which function reports the current position of the file pointer?

Arewind()
Bfseek()
Cftell()
Dfopen()
Answer is hidden
Question 31 of 72Object-oriented programming concepts

A class is best described as a:

AA running instance of an object
BA blueprint/template that defines data and behavior
CA single function
DA memory address
Answer is hidden
Question 32 of 72Object-oriented programming concepts

Function overloading is an example of which kind of polymorphism?

ADynamic (run-time)
BStatic (compile-time)
CNo polymorphism at all
DVirtual polymorphism
Answer is hidden
Question 33 of 72Object-oriented programming concepts

Which access specifier allows access from the class itself and its derived classes only?

Aprivate
Bprotected
Cpublic
Dfriend
Answer is hidden
Question 34 of 72Object-oriented programming concepts

Method overriding, using virtual functions, is resolved:

AAt compile time
BAt run time
CDuring linking only
DNever
Answer is hidden
Question 35 of 72Object-oriented programming concepts

Encapsulation refers to:

AHiding a class's implementation details only
BBundling data and the methods that operate on it within a class
CCreating multiple objects of a class
DInheriting from a base class
Answer is hidden
Question 36 of 72Object-oriented programming concepts

Which special member function has the same name as the class and no return type?

ADestructor
BConstructor
CFriend function
DStatic function
Answer is hidden
Question 37 of 72Object-oriented programming concepts

In C++, dynamically allocated memory for an object must be released using:

AAn automatic garbage collector
Bdelete
CA destructor call only, never delete
DThe this pointer
Answer is hidden
Question 38 of 72Object-oriented programming concepts

The 'this' pointer inside a non-static member function refers to:

AThe base class
BThe object on which the function was called
CA static data member
DThe compiler itself
Answer is hidden
Question 39 of 72Object-oriented programming concepts

A static data member of a class:

AHas a separate copy for every object
BIs shared by all objects of the class, only one copy exists
CCannot be accessed by any member function
DIs destroyed with every object
Answer is hidden
Question 40 of 72Object-oriented programming concepts

A friend function of a class can:

AOnly access public members of that class
BAccess the private and protected members of that class despite not being a member
CNever be called from outside the class
DOnly be a member of another class
Answer is hidden
Question 41 of 72Streams, file handling

Which C++ stream class is used specifically for reading from a file?

Aofstream
Bifstream
Cfstream
Diostream
Answer is hidden
Question 42 of 72Streams, file handling

Which stream state flag indicates that the end of a file has been reached?

Agoodbit
Beofbit
Cfailbit
Dbadbit
Answer is hidden
Question 43 of 72Streams, file handling

cin is a predefined object of which class?

Aostream
Bistream
Cfstream
Diosbase only
Answer is hidden
Question 44 of 72Streams, file handling

Which header defines manipulators like setw() and setprecision()?

A<iostream>
B<fstream>
C<iomanip>
D<cstdio>
Answer is hidden
Question 45 of 72Streams, file handling

Which functions perform unformatted (raw) I/O in C++ streams?

Acin >> and cout <<
Bget(), put(), read(), write()
Csetw() and setfill()
Dseekg() and seekp()
Answer is hidden
Question 46 of 72Streams, file handling

Which function moves the 'get' pointer to a specific position in a file, enabling random access?

Atellg()
Bseekg()
Cclose()
Dopen()
Answer is hidden
Question 47 of 72Streams, file handling

Which base class do istream and ostream derive from?

Aiostream
Bios
Cfstream
Dstreambuf only
Answer is hidden
Question 48 of 72Streams, file handling

Which manipulator inserts a newline and flushes the output buffer?

Asetw()
Bendl
Csetprecision()
Dhex
Answer is hidden
Question 49 of 72Streams, file handling

Which function reports the current position of the 'put' pointer in a file stream?

Atellp()
Bseekg()
Ceof()
Dclear()
Answer is hidden
Question 50 of 72Streams, file handling

To reset a stream's error state flags after an error, which function is used?

Afail()
Bclear()
Ceof()
Dgood()
Answer is hidden
Question 51 of 72Templates

Which keyword pair is used to declare a function template in C++?

Aclass template
Btemplate<class T> / template<typename T>
Cgeneric function
Dtemplate function T
Answer is hidden
Question 52 of 72Templates

The process of the compiler generating a specific version of a template for an actual data type is called:

AOverloading
BInstantiation
COverriding
DEncapsulation
Answer is hidden
Question 53 of 72Templates

When both a template and a non-template function match a call equally well, the compiler generally prefers:

AThe template version
BThe non-template (ordinary) function
CNeither, it is an error
DA random choice
Answer is hidden
Question 54 of 72Templates

A class template such as Stack<T> allows creation of:

AOnly one fixed-type Stack
BStacks of any data type, e.g. Stack<int>, Stack<float>
COnly integer stacks
DStacks with no type at all
Answer is hidden
Question 55 of 72Templates

Member functions of a class template are defined outside the class using which syntax pattern?

AClassName::functionName() only
Btemplate<class T> ReturnType ClassName<T>::functionName()
Cfunction ClassName()
DT::ClassName::functionName()
Answer is hidden
Question 56 of 72Templates

Which STL component stores collections of objects, such as vector or map?

AAlgorithms
BIterators
CContainers
DTemplates only
Answer is hidden
Question 57 of 72Templates

Which STL component behaves like a generalized pointer used to traverse a container?

AAlgorithm
BIterator
CContainer
DTemplate parameter
Answer is hidden
Question 58 of 72Templates

Which of these is an STL algorithm rather than a container?

Avector
Bmap
Csort()
Dlist
Answer is hidden
Question 59 of 72Templates

The STL achieves type-independence mainly through the use of:

AFunction overloading only
BTemplates
CFriend functions
DStatic members
Answer is hidden
Question 60 of 72Templates

A function template allows:

AA single function definition to work with multiple data types
BOnly integer arguments to be used
CAutomatic exception handling
DDirect file access
Answer is hidden
Question 61 of 72Computer Architecture & Hardware

When an interrupt occurs, the CPU transfers execution to:

AInterrupt Service Routine (ISR)
BMain program counter
CStack pointer
DAccumulator
Answer is hidden
Question 62 of 72Computer Architecture & Hardware

The 8086 microprocessor operates in which two modes?

AReal mode and Protected mode
BMinimum mode and Maximum mode
CUser mode and Kernel mode
DSingle-bus and Multi-bus mode
Answer is hidden
Question 63 of 72Computer Architecture & Hardware

Assembly language source code is translated to machine code by:

AAssembler
BCompiler
CInterpreter
DLinker
Answer is hidden
Question 64 of 72Computer Architecture & Hardware

The 8255 Programmable Peripheral Interface (PPI) provides which type of interface?

APhysical
BLogical
CSerial
DOptical
Answer is hidden
Question 65 of 72Computer Architecture & Hardware

RISC (Reduced Instruction Set Computer) architecture is characterized by:

AComplex variable-length instructions and small register file
BLarge number of registers, fixed instruction size, and pipelining
CMicrocode-based execution and many addressing modes
DSlow clock speed and large instruction cache
Answer is hidden
Question 66 of 72Computer Architecture & Hardware

What does the Address Generation Unit (AGU) in a CPU do?

AExecutes floating-point operations
BComputes effective memory addresses
CManages cache replacement
DDecodes instruction opcodes
Answer is hidden
Question 67 of 72Computer Architecture & Hardware

Pipelining in CPU design is also known as:

AParallel processing
BMultiprogramming
CAssembly-line operation / Instruction overlapping
DSuperscalar execution
Answer is hidden
Question 68 of 72Computer Architecture & Hardware

How many signal wires does the I²C (Inter-Integrated Circuit) bus use?

A1
B2
C3
D4
Answer is hidden
Question 69 of 72Computer Architecture & Hardware

A microprocessor fetches its next instruction from:

ACache memory
BRegister file
CMain memory (RAM)
DAccumulator
Answer is hidden
Question 70 of 72Computer Architecture & Hardware

In an SPI bus running at 5 MHz with 8-bit frames, what is the time taken per bit?

A0.02 μs
B0.2 μs
C2 μs
D20 μs
Answer is hidden
Question 71 of 72Computer Architecture & Hardware

Which circuit inside the CPU performs arithmetic and logical operations?

AControl Unit
BALU
CRegister File
DMemory Controller
Answer is hidden
Question 72 of 72Computer Architecture & Hardware

In floating-point multiplication, the correct sequence of operations is:

AAdd exponents, multiply mantissas, then normalize and round
BMultiply exponents, add mantissas, then normalize
CSubtract exponents, multiply mantissas, then normalize
DMultiply mantissas, multiply exponents, then round
Answer is hidden
← PREVIOUS CHAPTERCh 2: Software Engineering and Object-Oriented Analysis & DesignNEXT CHAPTER →Ch 4: Data Structures and Algorithm, Database System and Operating System