SW Engg MCQ
SW Engg MCQ
A
Always
B
Sometimes
C
Many times
D
No time
Answer A
___________________________________________________________________________________________
Top down approach is used for
A
Development
B
Identification of faults
C
Testing and validation
D
Reverse engineering
Answer A
___________________________________________________________________________________________
The first item defined for a new system is its
A
Storage
B
Outputs
C
Inputs
D
Processing
Answer B
___________________________________________________________________________________________
Software engineering primarily aims on
A
reliable software
B
cost effective software
C
reliable and cost effective software
D
none of the above
Answer C
___________________________________________________________________________________________
Output comparators are used in
A
Static testing of single module
B
Dynamic testing of single module
C
Static testing of single and multiple module
D
Dynamic testing of single and multiple module
Answer D
___________________________________________________________________________________________
The feature of the object oriented paradigm which helps code reuse is
A
Object
B
Class
C
Inheritance
D
Aggregation
Answer C
___________________________________________________________________________________________
Which one of the following ISO standard is used for software process?
A
ISO 9000
B
ISO 9001
C
ISO 9003
D
ISO 9000-3
Answer D
___________________________________________________________________________________________
Software Engineering is a discipline that integrates _________ for the development of computer software.
A
Process
B
Methods
C
Tools
D
All
Answer D
___________________________________________________________________________________________
What is the first stage in program development ?
A
Specification and design
B
System Analysis
C
Testing
D
None of the above
Answer B
___________________________________________________________________________________________
Pseudocode can replace
A
Flowcharts
B
Structure charts
C
Decision tables
D
Cause-effect graphs
Answer A
___________________________________________________________________________________________
Modules X and Y operate on the same input and output data, then the cohesion is
A
Sequential
B
Communicational
C
Procedural
D
Logical
Answer B
___________________________________________________________________________________________
Main aim of software engineering is to produce
A
Program
B
Software
C
Within budget
D
Software within budget in the given schedule
Answer D
___________________________________________________________________________________________
Which of the following are advantages of using LOC (lines of code) as a size oriented metric?
A
LOC is easily computed
B
LOC is a language dependent measure
C
LOC is a language independent measure
D
LOC can be computed before a design is completed
Answer A
___________________________________________________________________________________________
FAST stands for
A
Functional Application Specification Technique
B
Fast Application Specification Technique
C
Facilitated Application Specification Technique
D
None of the above
Answer C
___________________________________________________________________________________________
An object encapsulates
A
Data
B
Behaviour
C
State
D
Both Data and behaviour
Answer D
___________________________________________________________________________________________
Which of the following statements is true
A
Abstract data types are the same as classes
B
Abstract data types do not allow inheritance
C
Classes cannot inherit from the same base class
D
Object have state and behavior
Answer B
___________________________________________________________________________________________
The ISO quality assurance standard that applies to software engineering is
A
ISO 9000
B
ISO 9001
C
ISO 9002
D
ISO 9003
Answer B
___________________________________________________________________________________________
The main activity of the design phase of the system life cycle is to
A Replace the old system with new one
B Develop and test the new system
C Understand the current system
D Propose alternatives to the current system
Answer D
Which leads to blocking states in which some project team members must wait for the other members of
the team to complete dependent tasks?
A
Ad hoc approach of prototyping
B
Iterative nature of spiral model
C
Linear nature of classic life cycle
D
None of the above
Answer C
___________________________________________________________________________________________
Many causes of the software crisis can be traced to mythology based on
A
Management Myths
B
Customer Myths
C
Practitioner Myths
D
All of the above
Answer D
___________________________________________________________________________________________
Prototyping is used to
A
test the software as an end product
B
expand design details
C
refine and establish requirements gathering
D
None of the above
Answer C
___________________________________________________________________________________________
The most important feature of spiral model is
A Requirement analysis
B Risk management
C Quality management
D Configuration management
Answer B
Which phase is not available in software life cycle?
A
Coding
B
Testing
C
Maintenance
D
Abstraction
Answer D
___________________________________________________________________________________________
Which model is popular for students small projects ?
A
Waterfall Model
B
Spiral Model
C
Quick and Fix model
D
Prototyping Model
Answer A
___________________________________________________________________________________________
What is an incremental software process model that emphasize an extremely short development cycle?
A
RAD
B
Prototyping
C
Spiral
D
None of these
Answer A
___________________________________________________________________________________________
Which of these terms is a level name in the Capability Maturity Model?
A
Ad hoc
B
Repeatable
C
Reusable
D
Organized
Answer C
For a well understood data processing application it is best to use
A
The waterfall model
B
Prototyping model
C
The evolutionary model
D
The spiral model
Answer A
___________________________________________________________________________________________
A major defect in waterfall model in software development is that
A
The documentation is difficult
B
A blunder at ant stage can be disastrous
C
A trial version is available at the end of the project
D
The maintenance of the software is difficult
Answer C
___________________________________________________________________________________________
A COCOMO model is
A
Common Cost Estimation Model
B
Constructive Cost Estimation Model
C
Complete Cost Estimation Model
D
Comprehensive Cost Estimation Model
Answer B
___________________________________________________________________________________________
The model remains operative until the software is retired
A
Waterfall
B
Incremental
C
Spiral
D
None of these
Answer C
___________________________________________________________________________________________
Which design model is analogous to the detailed drawings of the access points and external utilities for a
house?
A
Architectural design
B
Component-level design
C
Data design
D
Interface design
Answer D
___________________________________________________________________________________________
Which of the following models can be used to represent the architectural design of a piece of software?
A
Dynamic models
B
Functional models
C
Structural models
D
All of these
Answer D
___________________________________________________________________________________________
Design phase will usually be
A
top-down
B
bottom-up
C
random
D
centre fringing
Answer A
___________________________________________________________________________________________
In a function oriented design, we
A
minimize cohesion and maximize coupling
B
maximize cohesion and minimize coupling
C
maximize cohesion and maximize coupling
D
minimize cohesion and minimize coupling
Answer B
___________________________________________________________________________________________
Content design is conducted by
A
Copywriters and graphic designer
B
Web engineers
C
Both a and b
D
None of the above
Answer C
___________________________________________________________________________________________
Top-down design does not require
A
step-wise refinement
B
loop invariants
C
flow charting
D
modularity
Answer B
___________________________________________________________________________________________
OPERATING SYSTEM
Multiprogramming systems
A
Are easier to develop than single programming systems
B
Execute each job faster
C
Execute more jobs in the same time period
D
Are used only one large mainframe computers
Answer C
___________________________________________________________________________________________
The operating system creates _____ from the physical computer
A
Virtual space
B
Virtual computers
C
Virtual device
D
None
Answer B
___________________________________________________________________________________________
The primary purpose of an operating system is
A
To make the most efficient use of the computer hardware
B
To allow people to use the computer
C
To keep systems programmers employed
D
To make computers easier to use
Answer A
___________________________________________________________________________________________
Overlay is
A A part of Operating System
B A specific memory location
C A single contiguous memory that was used in the olden days for running large programs by swapping
D Overloading the system with many user files
Answer C
___________________________________________________________________________________________
Link encryption
A
Is more secure than end to end encryption
B
Is less secure than end to end encryption
C
Cannot be used in a large network
D
Is used only detect errors
Answer B
___________________________________________________________________________________________
Which is built directly on the hardware?
A
Computer Environment
B
Application Software
C
Operating System
D
Database System
Answer C
___________________________________________________________________________________________
An operating system
A
Is not required on large computers
C
D
Which is the layer of a computer system between the hardware and the user
program
A
Operating environment
B
Operating system
C
System environment
D
None
Answer B
______________________________________________________________________
_____________________
A page fault means that we referenced a page
A
Outside the memory boundaries
B
With an incorrect I/O request
C
That was not in secondary storage
D
That was not in main memory
Answer D
______________________________________________________________________
_____________________
Protection against computer viruses
A Prevention
B Practice of safe computing
C Purchasing unopened software from vendors
D Avoiding free or pirated copies from public sources
Answer D
______________________________________________________________________
_____________________
A relationship between processes such that each has some part (critical section)
which must not be executed while the critical section of another is being executed,
is known as
A
Semaphore
B
Mutual exclusion
C
Multiprogramming
D
Message passing
Answer B
______________________________________________________________________
_____________________
Which of the following information bits used by the various page replacement
policies indicates if the page has been called lately?
A
Locality bit
B
Status bit
C
Referenced bit
D
Modified bit
Answer C
______________________________________________________________________
_____________________
Situations where two or more processes are reading or writing some shared datas
and the final result depends on who runs precisely when are called
A
Race conditions
B
Critical sections
C
Mutual exclusions
D
Message passing
Answer A
________________________________________________________________________
___________________
Switching the CPU to another Process requires to save state of the old process and
loading new process state is called as
A
Process Blocking
B
Context Switch
C
Time Sharing
D
None of the above
Answer B
________________________________________________________________________
___________________
A page fault
A is an error specific page.
B is an access to the page not currently in memory.
C occur when a page program occur in a page memory.
D
page used in the previous page reference.
Answer B
________________________________________________________________________
___________________
Cooperating processes can
A Only share a logical address space directly that is, both code and data
B Access concurrently to shared data may result in data consistency
C Either directly share a logical address space or be allowed to share data only through
files or messages
D None of these responses are correct
Answer C
________________________________________________________________________
___________________
A program is located in the smallest available hole in the memory
is _________
A
best fit
B
first bit
C
worst fit
D
buddy
Answer A
A thread
A Is a lightweight process where the context switching is low
B Is a lightweight process where the context switching is high
C Is used to speed up paging
D None of the above
Answer A
__________________________________________________________________________
_________________
Inter process communication
A
Is never necessary
B
Allows processors to synchronize
C
Is required for all processes
D
Is usually done via disk drives
Answer B
__________________________________________________________________________
_________________
In round robin CPU scheduling as time quantum is increased the average turn around
time
A
increases
B
decreases
C
remains constant
D
varies irregularly
Answer D
__________________________________________________________________________
_________________
Pre-emptive scheduling is the strategy of temporarily suspending a gunning process
A
before the CPU time slice expires
B
to allow starving processes to run
C
when it requests I/O
D
to avoid collision
Answer A
__________________________________________________________________________
_________________
Cascading termination refers to termination of all child processes before the parent
terminates
A
Normally
B
Abnormally
C
Normally or abnormally
D
None of these
Answer C
__________________________________________________________________________
_________________
Consider the methods used by processes P1 and P2 for accessing their critical sections. The
initial values of shared Boolean variables S1 and S2 are randomly assigned,
P1
P2
while (S1 = = S2);
while (S1 = = S2);
critical section
critical section
S1 = S2;
S1 = S2;
Which one of the following statements describes the properties achieved ?
A
Mutual exclusion but not progress
B
Progress but not mutual exclusion
C
Neither mutual exclusion nor progress
D
Both mutual exclusion and progress
Answer C
_______________________________________________________________________________
____________
The scheduling in which CPU is allocated to the process with least CPU-burst time is called
A
Priority Scheduling
B
Shortest job first Scheduling
C
Round Robin Scheduling
D
Multilevel Queue Scheduling
Answer B
_______________________________________________________________________________
____________
The simplest way to break a deadlock is to
A Preempt a resource
B Rollback
C Kill one of the processes
D Lock one of the processes
Answer C
A scheduler which selects processes from secondary storage device is called
A
Short term scheduler
B
Long term scheduler
C
Medium term scheduler
D
Process scheduler
Answer C
_________________________________________________________________________________
__________
Banker s algorithm for resource allocation deals with
A
Deadlock prevention
B
Deadlock avoidance
C
Deadlock recovery
D
Mutual exclusion
Answer B
_________________________________________________________________________________
__________
The completion order of the 3 processes under the policies FCFS and RR2 (round robin
scheduling with CPU quantum of 2 time units) are
A
FCFS: P1, P2, P3 RR2: P1, P2, P3
B
FCFS: P1, P3, P2 RR2: P1, P3, P2
C
FCFS: P1, P2, P3 RR2: P1, P3, P2
D
FCFS: P1, P3, P2 RR2: P1, P2, P3
Answer C
_________________________________________________________________________________
__________
Indefinite blocking is called
A
Deadlock
B
Starvation
C
Both a and b
D
None of these
Answer B
_________________________________________________________________________________
__________
A solution to the critical section problem must satisfy which requirements?
A
Bounded waiting, monitor and relative speed
B
Semaphores, monitor and prevention of deadlock
C
Signal, wait and continue
D
Mutual exclusion, progress and bounded waiting
Answer D
_________________________________________________________________________________
__________
_____________ is one preemptive scheduling algorithm.
A
Shortest job first
B
Round robin
C
Priority based
D
Shortest job next
Answer A
Suppose it takes 100 ns to access a page table and 20 ns to access associative memory with a 90%
hit rate, the average access time equals:
A
20 ns
B
28 ns
C
90 ns
D
100 ns
Answer B
___________________________________________________________________________________
________
Moving process from main memory to disk is called
A
Scheduling
B
Catching
C
Swapping
D
Spooling
Answer C
___________________________________________________________________________________
________
Virtual memory is
A
related to virtual reality
B
a form of ROM
C
a form of RAM
D
None of the above
Answer C
___________________________________________________________________________________
________
___________ is a technique of temporarily removing inactive programs from the memory of
computer system.
A
Swapping
B
Spooling
C
Semaphore
D
Scheduler
Answer A
___________________________________________________________________________________
________
Fragmentation of the file system
A Occurs only if file system is used improperly
B Can always be prevented
C Can be temporarily removed by compaction
D Is the characteristic of all the file systems
Answer C
The file structure that redefines its first record at a base of zero uses the term
A
Relative organization
B
Key fielding
C
Dynamic reallocation
D
Hashing
Answer A
________________________________________________________________________________________
___
Which of the following types of terminals is entirely dependent for all its capabilities on the computer
system to which it is connected?
A
Smart terminal
B
Dumb terminal
C
Micro computer
D
None of these
Answer B
________________________________________________________________________________________
___
File record length
A
Should always be fixed
B
Should always be variable
C
Depends upon the size of the file
D
Should be chosen to match the data characteristics
Answer D
________________________________________________________________________________________
___
FAT stands for
A
File Accomodation Table
B
File Access Tape
C
File Allocation Table
D
File Activity Table
Answer C
________________________________________________________________________________________
___
________ is the time required by a sector to reach below read/write head.
A
Seek Time
B
Latency Time
C
Access time
D
None
Answer B
Which of the following is the principal difference between a monochrome monitor and an RGB monitor?
A
Number of electron guns
B
Resolution
C
Size
D
Cost
Answer A
__________________________________________________________________________________________
_
A file sometimes called a
A
Collection of input data
B
Data set
C
Temporary place to store data
D
Program
Answer B
__________________________________________________________________________________________
_
There are no cycles of
A
General graph directory
B
Cyclic graph directory
C
One level directory
D
Two level directory
Answer B
__________________________________________________________________________________________
_
Solution of name collision problem is
A
Single level directory
B
Two level directory
C
Tree structure
D
All of these
Answer B
__________________________________________________________________________________________
_
When used with I\O devices the term intelligent implies
A
A color output capability
B
Speech processing capability
C
High speed printing capability
D
Features to support off line and online tasks
Answer D
__________________________________________________________________________________________
_
Optical storage is a
A
high-speed direct access storage device.
B
low-speed direct access storage device.
C
medium-speed direct access storage device.
D
high-speed sequential access storage device.
Answer C
__________________________________________________________________________________________
_
Memory protection is normally done by the
A
Processor and the associated hardware
B
Operating system
C
Compiler
D
User program
Answer A
__________________________________________________________________________________________
_
Program threats are
A
Trojan horse
B
Trap door
C
Both A and B
D
None of these
Answer C
__________________________________________________________________________________________
_
Which of the following is the process by which a users access to physical data in the application is limited,
based on his privileges ?
A
Authorization
B
Authentication
C
Access Control
D
All of these
Answer C
__________________________________________________________________________________________
_
Worm was made up
A One program
B Two program
C Three program
D All of these
Answer B
Trojan horse
A
A code segment that misuses its file is called trojan horse
B
Good for file accessing
C
Both A and B
D
None of these
Answer A
___________________________________________________________________________________________
A major security problem for operating system is
A
Authentication problem
B
Physical problem
C
Human problem
D
None of these
Answer A
___________________________________________________________________________________________
To protect system,there are how many security levels?
A
One
B
Two
C
Three
D
Four
Answer C
___________________________________________________________________________________________
Which of the following topologies consists of multiple CPUs connected by a single communication line
running the length of the network?
A
Tree
B
Ring
C
Star
D
Bus
Answer D
___________________________________________________________________________________________
Which of the following is the process by which a users privileges ascertained ?
A
Authorization
B
Authentication
C
Access Control
D
None of these
Answer A
___________________________________________________________________________________________
An audit log
A
Simply records the time
B
User
C
Type of all access to an object
D
All of these
Answer B
___________________________________________________________________________________________
All of the following are examples of real security and privacy risks except
A
Hackers
B
Spam
C
Viruses
D
Identify theft
Answer B
___________________________________________________________________________________________
Security violation due to
A
Malicious
B
Accidental
C
Both A and B
D
None of these
Answer C
___________________________________________________________________________________________
A public key encryption system
A
Allows only the correct receiver to decode the data.
B
Allows only one to decode the transmission.
C
Allows only the correct sender to decode the data.
D
Does not encode the data before transmitting it.
Answer A
___________________________________________________________________________________________
Which model estimates the total effort in terms of person,months of the technical project staff?
A
Spiral
B
Waterfall
C
Prototyping
D
COCOMO model
Answer D
Lowest level of security is
A
A
B
B
C
C
D
D
Answer A
___________________________________________________________________________________________
Bootstrap or vector is called
A
Grappling hook program
B
Main program
C
Secondary program
D
Primary storage
Answer B
___________________________________________________________________________________________
Imperative language
Declarative language
Standard
None of these
Answer B
___________________________________________________________________________________________
Node in XML is
A Any part of the document whether it is elements ,attributes or otherwise
B Referred only to the attributes
C Referred to the top element in the document
D None of these
Answer A
Well formed XML document means
A It contains a root element
B It contain an element
C It contains one or more elements
D Must contain one or more elements and root element must contain all other elements
Answer D
___________________________________________________________________________________________
XML DSOs has the property for the number of pages of data the recordset contains
A
Count
B
Number
C
Pagecount
D
Pagenumber
Answer C
___________________________________________________________________________________________
There is a way of describing XML data,how?
A
XML uses a DTD to describe the data.
B
XML uses XSL to describe data.
C
XML uses a description node to describe data
D
Both A and C.
Answer D
___________________________________________________________________________________________
A parser
Specification
Coding style
None of these
Answer A
___________________________________________________________________________________________
XPATH used to
A
Address your documents by specifying a location path
B
Address the server
C
Store the IP of the server
D
None of these
Answer A
___________________________________________________________________________________________
The XML DOM object is
A
Entity
B
Entity reference
C
Comment reference
D
Comment data
Answer B
___________________________________________________________________________________________
XML document can be viewed in
A
IE 3.0
B
IE 2.0
C
IE 6.0
D
IE X.0
Answer C
___________________________________________________________________________________________
What is so great about XML?
A
Easy data exchange
B
High speed on network
C
Both A and B
D
None of the above
Answer C
___________________________________________________________________________________________
Unl ike Ipv4, Ipv6 does not include the following field in the base header
A
Next Header field
B
Field for Fragmentation information
C
Flow Label
D
Kind field
Answer B
___________________________________________________________________________________________
FDDI (Fiber Distributed Data Interconnect) is an example of
A
Token ring
B
Token bus
C
Star topology
D
Multipoint network
Answer A
UNIX LINUX
Which of the following statement best explains a process?
A
It is a program.
B
It is a program in execution.
C
It is an instance of a program in execution.
D
It is a program that uses system calls.
Answer C
___________________________________________________________________________________________
In which section of a process,the information about the arguments to the program are available?
A
Data
B
Text
C
Stack
D
User block
Answer C
___________________________________________________________________________________________
Choose the incorrect statement
A
Shell scripts can accept arguments
B
Shell scripts are interpreted
C
Shell is a programming language
D
Shell scripts are compiled
Answer D
___________________________________________________________________________________________
UNIX was developed by
A
Bell labs
B
Berkley software
C
California university
D
American defence academy
Answer A
___________________________________________________________________________________________
Which command is used to change protection mode of files starting with the string emp and ending with 1,2, or 3?
A
B
C
D
Which command is used to sort the lines of data in a file in reverse order
A
sort
B
sh
C
st
D
sort -r
Answer D
___________________________________________________________________________________________
Which of the following commands is used to rename a file?
A
Rename
B
MV
C
Remove
D
Ren
Answer B
Which of the following calls never returns an error?
A
Getpid
B
Fork
C
Ioct1
D
Open
Answer A
___________________________________________________________________________________________
Which command is used to display a file contents in octal form?
A
cd
B
of
C
od
D
oct
Answer C
___________________________________________________________________________________________
Which of the following is not a communication command?
A
write
B
mail
C
mesg
D
grep
Answer D
___________________________________________________________________________________________
Which of the following commands is used to count the total number of lines,words and characters
contained in a file?
A
count p
B
wcount
C
wc
D
count w
Answer C
___________________________________________________________________________________________
Profilers are
A
Tools that analyze the run time behavior of a program
B
Tools that check C code for cross file consistency
C
Tools that keep track of evolving versions of a file
D
None of the above
Answer A
___________________________________________________________________________________________
Which of the following tools can be used to keep track of evolving version of a file?
A
Make
B
Yacc
C
SCCS
D
dv
Answer C
Which command is used to display and create files?
A
cat
B
ed
C
vi
D
lyrix
Answer A
___________________________________________________________________________________________
Files that can store data in the same format as used in program are called
A
Binary files
B
Source file
C
Text file
D
Core
Answer A
___________________________________________________________________________________________
The file that stores an integer as a sequence of characters is a
A
Text file
B
Data file
C
Binary file
D
Core
Answer A
___________________________________________________________________________________________
Which is the earliest and most widely used shell that came with the UNIX system?
A
C Shell
B
Korn Shell
C
Bourne Shell
D
Smith Shell
Answer C
___________________________________________________________________________________________
D
Overloaded
Answer C
___________________________________________________________________________________________
A friend function to a class, C cannot access
A
Private data members and member functions
B
Public data members and member functions
C
Protected data members and member functions
D
The data members of the derived class of C
Answer D
In access control in a protected derivation, visibility modes will change as follows
A
Private, public and protected become protected
B
Only public becomes protected
C
Public and protected become protected
D
Only private becomes protected
Answer C
___________________________________________________________________________________________
Which of the following cannot be legitimately passed to a function
A
A constant
B
A variable
C
A structure
D
A header file
Answer D
___________________________________________________________________________________________
When the compiler cannot differentiate between two overloaded constructors, they are called
A
Overloaded
B
Destructed
C
Ambiguous
D
Dubious
Answer C
___________________________________________________________________________________________
If a base class destructor is not virtual, then
A
It can not have a function body
B
It can not be called
C
It can not be called when accessed from pointer
D
Destructor in derived class can not be called when accessed through a pointer to the base class
Answer D
___________________________________________________________________________________________
A function call mechanism that passes arguments to a function by passing a copy of the values of the arguments is
__________
A
Call by name
B
Call by value
C
Call by reference
D
Call by value result
Answer B
___________________________________________________________________________________________
A variable defined within a block is visible
A
From the point of definition onward in the program
B
From the point of definition onward in the function
C
From the point of definition onward in the block
D
Throughout the function
Answer C
___________________________________________________________________________________________
RunTime polymorphism is achieved by ___________
A
Friend function
B
Virtual function
C
Operator overloading
D
Function overloading
Answer B
___________________________________________________________________________________________
This pointer
A
Implicitly points to an object
B
Can be explicitly used in a class
C
Can be used to return an object
D
All of the above
Answer D
___________________________________________________________________________________________
A __________ is a special method used to initialize the instance variable of a class.
A
Member function
B
Destructor
C
Constructor
D
Structure
Answer C
___________________________________________________________________________________________
Additional information sent when an exception is thrown may be placed in
A
The throw keyword
B
The function that caused the error
C
The catch block
D
An object of the exception class
Answer C
C
Abstraction
D
Data hiding
Answer B
___________________________________________________________________________________________
If a class C is derived from class B, which is derived from class A, all through public inheritance, then a class C
member function can access
A
Protected and public data only in C and B
B
Protected and public data only in C
C
Private data in A and B
D
Protected data in A and B
Answer D
___________________________________________________________________________________________
The process of building new classes from existing one is called ______.
A
Polymorphism
B
Structure
C
Inheritance
D
Cascading
Answer C
___________________________________________________________________________________________
This type of inheritance is a mixture of multiple inheritance and hierarchical inheritance
A
Single inheritance
B
Multiple inheritance
C
Hierarchical inheritance
D
Hybrid inheritance
Answer D
___________________________________________________________________________________________
The base class access specification determines how ___________ members in the base class may be accessed by
derived classes.
A
Private
B
Public
C
Protected
D
A,Band C
Answer D
___________________________________________________________________________________________
A base class may also be called a
A
Child class
B
Subclass
C
Derived class
D
Parent class
Answer D
___________________________________________________________________________________________
In multiple inheritance
A
The base classes must have only default constructors
B
Cannot have virtual functions
C
Can include virtual classes
D
None of the above
Answer C
Which of the statements are true ?
I. Function overloading is done at compile time.
II. Protected members are accessible to the member of derived class.
III. A derived class inherits constructors and destructors.
IV. A friend function can be called like a normal function.
V. Nested class is a derived class.
A
I, II, III
B
II, III, V
C
III, IV, V
D
I, II, IV
Answer D
___________________________________________________________________________________________
_________ members of a base class are never accessible to a derived class.
A
Public
B
Private
C
Protected
D
A,B and C
Answer B
___________________________________________________________________________________________
Assume that we have constructor functions for both base class and derived class. Now consider the declaration in main(
). Base * P = New Derived; in what sequence will the constructor be called ?
A
Derived class constructor followed by Base class constructor.
B
Base class constructor followed by derived class constructor.
C
Base class constructor will not be called.
D
Base class constructor will not be called.
Answer B
___________________________________________________________________________________________
When a sub class is inherited from only one super class .It is known as
A
Single inheritance
B
Multiple inheritance
C
Hierarchical inheritance
D
Multilevel inheritance
Answer A
___________________________________________________________________________________________
In multiple inheritance
A
The base classes must have only default constructors
B
Cannot have virtual functions
C
Cannot have virtual classes
D
None of the above
Answer C
___________________________________________________________________________________________
The polymorphism can be characterized by the phrase
A
One interface,multiple methods
B
Multiple interfaces,one method
C
One interface,one method
D
None of the above
Answer A
___________________________________________________________________________________________
The mechanism that binds code and data together and keeps them secure from outside world is known as
A
Abstraction
B
Inheritance
C
Encapsulation
D
Polymorphism
Answer C
___________________________________________________________________________________________
The term __________ means the ability to take many forms.
A
Inheritance
B
Polymorphism
C
Member function
D
Encapsulation
Answer B
___________________________________________________________________________________________
Runtime polymorphism is achieved by
A
Friend function
B
Virtual function
C
Operator overloading
D
Function overloading
Answer B
___________________________________________________________________________________________
RunTime Polymorphism is achieved by ______
A
Friend function
B
Virtual function
C
Operator overloading
D
Function overloading
Answer B
Usually a pure virtual function
A
Has complete function body
B
Will never be called
C
Will be called only to delete an object
D
Is defined only in derived class
Answer D
___________________________________________________________________________________________
Encapsulation is
A
Dynamic binding
B
A mechanism to associate the code and data.
C
Data abstraction
D
Creating new class
Answer B
___________________________________________________________________________________________
Identify the operator that is NOT used with pointers
A
->
B
&
C
*
D
>>
Answer D
___________________________________________________________________________________________
If we create a file by ifstream, then the default mode of the file is _________
A
ios :: out
B
ios :: in
C
ios :: app
D
ios :: binary
Answer B
___________________________________________________________________________________________
If the variable count exceeds 100, a single statement that prints Too many is
A
if (count<100) cout << Too many;
B
if (count>100) cout >> Too many;
C
if (count>100) cout << Too many;
D
None of these.
Answer C
___________________________________________________________________________________________
What is the following code segment doing?
void fn( ){
char c;
cin.get(c);
if (c != \n) {
fn( );
cout.put(c);
}
}
A The string entered is printed as it is.
B The string entered is printed as it is.
C It will go in an infinite loop.
D It will print an empty line.
Answer B
Which of the following will produce a value 10 if x = 9.7?
A
floor(x)
B
abs(x)
C
log(x)
D
ceil(x)
Answer D
___________________________________________________________________________________________
The address of a variable temp of type float is
A
*temp
B
&temp
C
float& temp
D
float temp&
Answer B
___________________________________________________________________________________________
What will be the values of x, m and n after the execution of the following statements?
int x, m, n;
m = 10;
n = 15;
x = ++m + n++;
A
x=25, m=10, n=15
B
x=26, m=11, n=16
C
x=27, m=11, n=16
D
x=27, m=10, n=15
Answer B
___________________________________________________________________________________________
for (; ;)
A
means the test which is done using some expression is always true
B
is not valid
C
will loop forever
D
should be written as for( )
Answer C
___________________________________________________________________________________________
Consider the following statements:
int x = 22,y=15;
x = (x>y) ? (x+y) : (x-y);
What will be the value of x after executing these statements?
A
22
B
37
C
7
D
5
Answer B
___________________________________________________________________________________________
If an array is declared as int a[4] = {3, 0, 1, 2}, then values assigned to a[0] & a[4] will be ________
A
3, 2
B
0, 2
C
3, 0
D
0, 4
Answer C
___________________________________________________________________________________________
To access the public function fbase() in the base class, a statement in a derived class function fder() uses the
statement.fbase();
A
fbase();
B
fder();
C
base::fbase();
D
der::fder();
Answer A
___________________________________________________________________________________________
If x =5, y =2 then x ^y equals________.
(where ^ is a bitwise XOR operator)
A
00000111
B
10000010
C
10100000
D
11001000
Answer A
___________________________________________________________________________________________
What will be the output of following program?
#include<iostream.h>
void main()
{
float x;
x=(float)9/2;
cout<<x;
}
A
4.5
B
4.0
C
4
D
5
Answer A
___________________________________________________________________________________________
The operator << when overloaded in a class
A
must be a member function
B
must be a non member function
C
can be both (A) & (B) above
D
cannot be overloaded
Answer C
Which of the following is the valid class declaration header for the derived class d with base classes b1 and
b2?
A
class d : public b1, public b2
B
class d : class b1, class b2
C
class d : public b1, b2
D
class d : b1, b2
Answer A
___________________________________________________________________________________________
In C++, dynamic memory allocation is accomplished with the operator ____
A
new
B
this
C
malloc( )
D
delete
Answer A
___________________________________________________________________________________________
What is the error in the following code?
class t
{
virtual void print();
}
A
No error
B
Function print() should be declared as static.
C
Function print() should be defined.
D
Class t should contain data members.
Answer A
___________________________________________________________________________________________
What is the output of the following code
char symbol[3]={a,b,c};
for (int index=0; index<3; index++)
cout << symbol [index];
A
abc
B
abc
C
abc
D
abc
Answer C
___________________________________________________________________________________________