WorksheetsLOOPS in OOPS
Total questions: 20
Worksheet time: 7mins
A C++ program is made up of one or more (a) ?
Which section in a class definition is used for declaring is used for declaring the functions but not defining them?
Private section
Public section
Member section
Function section
In C++, you can use the (a) keyword to create instances of a class.
In C++,what is a class?
A reserved keyword
A user-defined data type
A constant value
A storage class
User-defined data types are created by the (a) .
Which of the following is NOT a component of a C++?
Source file
Header file
Namespace
Compiler
(a) is the concept of bundling data(attributes) and methods(functions) that operate on that data into a single unit.
Which of the following is NOT a basic concept of OOPS?
Inheritance
Loops
Encapsulation
Polymorphism
Objects of a class can also be returned from (a) .
Which of the following represent fixed values that do not change during the execution of a program?
Identifiers
Constants
Keywords
Basic data types
The (a) Control structure is used for multi-way decision-making in C++.
What control structure in C++ is used for handling multiple conditions in a structured manner?
if...else
for
break
while
An array of objects in C++ allow you to create multiple (a) objects.
Which control structure is used to replace is used to replace multiple "if" statements for multi-way decision-making?
if...Else
while
for
switch
The (a) statement is used to exit a loop prematurely.
Which control structure is used when you want to execute a block of code repeatedly as long as a condition is true?
if
while
switch
for
Keywords, identifiers, constants, and basic data types are examples of C++?
(a)
What is the purpose of "private" member functions in a class?
They are accessible from external code.
They are only accessible within the class itself.
They can be overridden in derived classes.
They are used to declare global functions.
Dynamic initialization of variables occurs at (a) during program execution.
What does specifying a class in C++ involve?
Defining the attributes and functions of the class.
Including the <iostream.h> header file.
Declaring variables in the global scope.
Writing the program's main function.
