Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
8 views5 pages

Oom Objectives

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views5 pages

Oom Objectives

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

OOM OBJECTIVES

(2022)

State whether the following statements are TRUE or FALSE:

(a) *True* – Encapsulation involves wrapping data and functions that manipulate the data into a
single unit, typically a class.

(b) *False* – Polymorphism and inheritance are related but different concepts. Polymorphism allows
objects of different types to be treated as instances of the same class, typically using virtual
functions.

(c) *True* – In C++, a function that is defined inside a class is called a member function.

(d) *True* – In C++, a character array is often called a string, though it's not a full string object like
std::string.

(e) *False* – The :: operator is the scope resolution operator, not used for comparing objects.

(f) *True* – When a function returns a value, the return can be assigned to a variable.

(g) *True* – The syntax for defining a class and a structure is similar in C++, with the main difference
being that members of a struct are public by default, while members of a class are private by default.

(h) *True* – Member functions of a class can be defined both inside or outside the class definition.

(i) *True* – A function can return an object in C++.

(j) *False* – Operator functions can return a value, for example, when overloading the + operator to
return a result.

(k) *True* – If objA and objB are of different classes and no conversion or assignment operator is
defined, it will cause a compiler error.

(L) *True* – This describes multilevel inheritance, where class D is derived from C, C from B, and B
from A.

(m) *True* – A void pointer (also known as a generic pointer) can point to any data type, but it must
be cast to the correct type before dereferencing.

(n) *False* – A class can have multiple constructors as long as they have different signatures (this is
known as constructor overloading).

(o) *True* – A friend function can access private and protected members of a class without being a
member of that class.

( 2023)

1. Fill in the blanks with correct terms:

(a) *Objects* are instances of a class.

(b) POP (Procedure-Oriented Programming) employs *procedural* programming approach.

(c) *Inheritance* is the process by which objects of one class acquire properties of objects of
another class.
(d) The operator >> is called the *extraction* operator.

(e) The operator << is called the *insertion* operator.

---

2. State whether the following statements are TRUE or FALSE:

(a) Dynamic binding means that the code associated with a given procedure is not known until the
time of the call at run-time.

*TRUE*

(b) Inheritance refers to putting essential features without including background details.

*FALSE* (This is abstraction, not inheritance.)

(c) In OOP, a problem is considered as a collection of number of entities called objects.

*TRUE*

(d) C++ is an example of POP.

*FALSE* (C++ supports both OOP and procedural programming.)

(e) A function can also return an object.

*TRUE*

(f) A constructor must have a different name than that of the class.

*FALSE* (A constructor has the same name as the class.)

(g) By default, members of a class are public.

*FALSE* (By default, they are private.)

(h) Polymorphism simply means one name having one form.

*FALSE* (Polymorphism means one name having many forms.)

(i) Similar to normal functions, constructors may be overloaded.

*TRUE*

(j) The static member variables must be defined inside the class.

*FALSE* (Static member variables are declared inside the class but defined outside.)

(2021)

Write TRUE or FALSE against the following statements:

(a) *False* – Friend functions have access to both private and protected members of a class, not just
public members.
(b) *False* – Polymorphism and inheritance are related but different concepts. Polymorphism allows
different class types to be treated through the same interface, but it is not extensively used in
implementing inheritance itself.

(c) *False* – Object-oriented programs are often slower than conventional programs due to
additional overhead from features like polymorphism, dynamic binding, and object management.

(d) *True* – A constructor can be used to convert a basic type to a class type by defining a
constructor that accepts the basic type as a parameter.

(e) *True* – When overloading an operator, at least one operand must be of a user-defined type
(like a class or struct).

(f) *False* – Classes can be changed, extended, or modified, especially through inheritance and
encapsulation.

(g) *True* – A constructor can be used to convert one class type to another, and this constructor is
typically defined in the source class.

(h) *True* – Containership (or composition) refers to the nesting of one class as a member within
another class.

(i) *False* – Making a base class virtual does not prevent the inheritance of its members. Virtual
inheritance is used to prevent multiple copies of base class members in the case of multiple
inheritance.

(j) *False* – When arguments are passed by value, the function works with a copy of the arguments,
not the original ones.

Fill in the blanks with appropriate answer for the followings:

(a) The traits of one class may be inherited by more than one class is known as *multiple
inheritance*.

(b) An object is bound to its function call at compile time, the process is known as *early binding* (or
*static binding*).

(c) When there are many inheritance paths between the base and derived classes, duplication of
members can be avoided by making *the base class* virtual.

(d) When a class inherits from more than one base class, it is called *multiple inheritance*.

(e) A function name must be followed by **parentheses ()** (even if there are no parameters).

2019

Write TRUE or FALSE against the following statements:

(a) *True* – One of the key features of object-oriented programming (OOP) is representing real-
world entities as objects.
(b) *False* – The printf() function can be used in C++ programs as C++ is backward compatible with
C, though cout is preferred in C++.

(c) *False* – An unsigned int cannot be twice as large as a signed int. The size of both is the same,
but unsigned int allows storing only non-negative values, effectively doubling the range for positive
numbers.

(d) *False* – When arguments are passed by value, the function works with a copy of the
arguments, not the original arguments.

(e) *False* – Class members are private by default in C++. In a struct, members are public by default.

(f) *True* – Constructors do not return any value, not even void.

(g) *True* – Operator overloading allows changing the meaning of an operator for user-defined
types.

(h) *False* – Defining a derived class does not require changes in the base class.

(i) *False* – Virtual functions are used for dynamic (runtime) polymorphism, allowing derived class
methods to be invoked through base class pointers.

(j) *True* – The this pointer points to the object that is currently used to invoke a member function.

Fill in the blanks:

(a) Procedural Programming Languages employ *a top-down* programming approach.

(b) C++ is a *superset* of C language.

(c) We can define a member function of a class outside of the class using the *scope resolution (::)*
operator.

(d) When a function is declared *inline*, the compiler replaces the function call with the respective
function code.

(e) In C++, the class variables are called *data members*.

2016

Fill in the blanks:

(a) C++ is an extension of *C*.

(b) We can replace multiple if...else statements with a single *switch* statement.

(c) *Character* constants are enclosed within single quotation marks.

(d) **Not (!)** operator returns true if the enclosed condition evaluates to false.

(e) The combining of data and functions into a single unit is called *encapsulation*.

(f) A variable of type long will take *4* bytes of memory (this may vary depending on the system
architecture).
(g) Functions with the same name but different in the number of arguments are called *overloaded
functions*.

(h) One derived class with many base classes is *multiple* inheritance.

(i) Private is default in *classes, whereas public is default in **structures*.

Choose the correct answer from the choices given:

(a). Scope resolution operator is

*(iii). ::*

(b). _ are used to store large amount of similar data items.

*(iii). Arrays*

(c). The operator overloading comes under the concept

*(i). Polymorphism*

(d). >> is called the

*(ii). Extraction operator*

(e). A _ has the same name as the class but is preceded by a tilde (~)

*(iii). Destructor*

You might also like