Topic 9 (PREFINALS) Flashcards
is one of the most essential and important features of object-oriented programming in C++.
Data abstraction
means displaying only essential information and ignoring the details.
Abstraction
refers to providing only essential information about the data to the outside world, ignoring unnecessary details or implementation.
Data abstraction
What are the types of abstraction?
Data Abstraction
Control Abstraction
This type only shows the required information about the data and ignores unnecessary details.
Data Abstraction
This type only shows the required information about the implementation and ignores unnecessary details.
Control Abstraction
refers to providing only essential information to the outside world and hiding their background details, i.e., to represent the needed information in program without presenting the details.
Data abstraction
is a programming (and design) technique that relies on the separation of interface and implementation.
Data abstraction
In C++, classes provides great level of ____ ________. They provide sufficient public methods to the outside world to play with the functionality of the object and to manipulate object data, i.e., state without actually knowing how class has been implemented internally.
Data abstraction
refers to the process of simplifying complex control flow by hiding low-level details and exposing only the necessary functionality. It helps in making code more readable, maintainable, and reusable by encapsulating control structures like loops, conditionals, and functions class inside higher-level of constructs.
Control Abstraction
Adheres to the core idea of DRY coding, which stands for Don’t Repeat Yourself, and the finest illustration of control abstraction is the use of functions in a program.
Control Abstraction
in C++ simplifies code by hiding unnecessary details and exposing only the essential control flow through functions, loops, classes, and STL algorithms. It helps in writing cleaner, more maintainable, and scalable programs, making development faster and more efficient.
Control Abstraction
What type of abstraction is used here “When you drive a car, you only interact with simple controls like the steering wheel, accelerator, brakes, and gear shift. You don’t need to worry about the complex mechanisms happening underneath, such as how the engine processes fuel, how the transmission works, or how braking systems apply force to the wheels.”
Control Abstraction
This is exactly how __________ works in C++. The driver (user) interacts with a high level interface (function, loops, classes) without needing to understand the internal control flow (engine operations, fuel combustion, braking mechanics)
Control Abstraction
What type of abstractions is used here “an ATM (Automated Teller Machine). When you use an ATM, you can perform essential actions like withdrawing money, checking your happening behind balance, and depositing cash. However, you don’t see the complex internal processes happening behind the scenes, such as how the ATM communicates with the bank, verifies your credentials, or updates your balance in the database.”?
Data abstraction
This exactly how ___________ works in C++, by exposing only the necessary functionalities through public methods while hiding the underlying implementation using private members.
Data abstraction
One more type of abstraction in C++ can be header files. For example, consider the pow() method present in math.h header file. Whenever we need to calculate the power of number, we simply call the function pow() present in the math.h header file and pass the numbers as arguments without knowing the underlying algorithm according to which the function is actually calculating the power of numbers
Abstraction in Header Files
We can implement abstraction in C++ using _______
classes.
The _____ helps us to group data members and member functions using available access specifiers.
Class
in C++ is a virtual function for which we can have an implementation, But we must override that function in the derived class, otherwise, the derived class will also become an abstract class.
Pure Virtual Function (or Abstract Function)
is declared by assigning 0 in the declaration.
Pure Virtual Function
Virtual Function is also known as _________.
Virtual Methods
is a member function that is declared within a base class and is re-defineed (overridden) by a derived class.
Virtual Function
When you refer to a derived class object using a pointer or a reference to the base class, you can call a virtual function for that object and execute the derived class’s version of the method.
Virtual Function