Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 2 out of 12 pages
Exam (elaborations)

Object Oriented Programming Test Questions with Correct Answers 100% Solved

Document preview thumbnail
Preview 2 out of 12 pages

Object Oriented Programming Test Questions with Correct Answers 100% Solved Inheritance - Answers Single inheritance - Answers enables a derived class to inherit properties and behavior from a single parent class. Multiple inheritance - Answers When a class is derived from multiple base classes Multi-level inheritance - Answers Hybrid inheritance - Answers Use of multiple types of inheritance Function overloading - Answers The ability of two functions with the same name but different parameters to exist in the same program or class. Templates - Answers A formula or blueprint for creating a generic class or a function Function of a constructor - Answers Initializes an object Object - Answers instance of a class Function of Destructor - Answers To free the memory consumed by program Polymorphism - Answers The ability of a variable, variable or object to take on multiple forms Enum - Answers Difference between structure and union - Answers Union is more memory centric Exception - Answers error condition that can occur during the normal course of program execution; exception is thrown Try Catch Block - Answers An exception handling process in programming where possible error generating situations are smoothly handled during execution, with the situation is enclosed inside the try section, and one or more catches are built in to handle the possible errors that may occur. This is a key feature in making very large programs robust and error free. Handling of runtime error - Answers Exception handling inline function - Answers Member functions defined inside the integration of the class A-D-T - Answers Abstract Data Type. It's a type of secondary or derived data type Abstraction - Answers A definiton that captures general characteristics Procedural Programming (POP) - Answers uses variables to store data, focuses on the process/functions that occur in a program. Data and functions are seperate and distinct Object-oriented programming (OOP) - Answers Based on objects that encapsulate the data and the functions that operate on and with the data :: - Answers Scope resolution operator (not overloadable) Syntax resolution operator syntax - Answers Class-name scope resolution object name Why use Object Oriented Programming? - Answers To solve and avoid the problem with data security in POP Object - Answers Software entity that combines data and functions that act on the data in a single unit Attributes - Answers The data items of an object in member variable should Class - Answers a programmer-defined data type Member functions (methods) - Answers procedures/functions that act on the attributes of the class Data hiding - Answers Restricting data access to certain members of an object. The intent is to allow only member functions to directly access and modify the object's data Encapsulation - Answers The building of a object's data and procedures into a single entity. Access specifier - Answers Used to control accesst to members of the class Member functions - Answers Accessor, mutator Standard structure of a program - Answers 1. Interface - all prototypes and header files 2. Implementation - all function definitions 3. Client-code - Standard structure of an OOP program - Answers 1. Class specification file - class.h 2. Class implementation file - 3. Client-code file - Use of scope resolution operator (::) - Answers data-type class-name :: member-function(){ //function definition ; } used in class implementation file

Content preview

Object Oriented Programming Test Questions with Correct Answers 100% Solved

Inheritance - Answers

Single inheritance - Answers enables a derived class to inherit properties and behavior from a single
parent class.

Multiple inheritance - Answers When a class is derived from multiple base classes

Multi-level inheritance - Answers

Hybrid inheritance - Answers Use of multiple types of inheritance

Function overloading - Answers The ability of two functions with the same name but different
parameters to exist in the same program or class.

Templates - Answers A formula or blueprint for creating a generic class or a function

Function of a constructor - Answers Initializes an object

Object - Answers instance of a class

Function of Destructor - Answers To free the memory consumed by program

Polymorphism - Answers The ability of a variable, variable or object to take on multiple forms

Enum - Answers

Difference between structure and union - Answers Union is more memory centric

Exception - Answers error condition that can occur during the normal course of program execution;
exception is thrown

Try Catch Block - Answers An exception handling process in programming where possible error
generating situations are smoothly handled during execution, with the situation is enclosed inside the
try section, and one or more catches are built in to handle the possible errors that may occur. This is a
key feature in making very large programs robust and error free.

Handling of runtime error - Answers Exception handling

inline function - Answers Member functions defined inside the integration of the class

A-D-T - Answers Abstract Data Type. It's a type of secondary or derived data type

Abstraction - Answers A definiton that captures general characteristics

Procedural Programming (POP) - Answers uses variables to store data, focuses on the process/functions
that occur in a program. Data and functions are seperate and distinct

, Object-oriented programming (OOP) - Answers Based on objects that encapsulate the data and the
functions that operate on and with the data

:: - Answers Scope resolution operator (not overloadable)

Syntax resolution operator syntax - Answers Class-name <scope resolution> object name

Why use Object Oriented Programming? - Answers To solve and avoid the problem with data security in
POP

Object - Answers Software entity that combines data and functions that act on the data in a single unit

Attributes - Answers The data items of an object in member variable should

Class - Answers a programmer-defined data type

Member functions (methods) - Answers procedures/functions that act on the attributes of the class

Data hiding - Answers Restricting data access to certain members of an object. The intent is to allow only
member functions to directly access and modify the object's data

Encapsulation - Answers The building of a object's data and procedures into a single entity.

Access specifier - Answers Used to control accesst to members of the class

Member functions - Answers Accessor, mutator

Standard structure of a program - Answers 1. Interface - all prototypes and header files

2. Implementation - all function definitions

3. Client-code - main.cpp

Standard structure of an OOP program - Answers 1. Class specification file - class.h

2. Class implementation file - class.cpp

3. Client-code file - main.cpp

Use of scope resolution operator (::) - Answers data-type class-name :: member-function(){

//function definition ;

}



used in class implementation file

Class conventions - Answers 1. member variables are private

Document information

Uploaded on
February 26, 2025
Number of pages
12
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$10.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
TutorJosh
3.5
(76)
Sold
495
Followers
16
Items
32839
Last sold
2 days ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions