Approach in C++
Object oriented programming languages like Java or C++ use a bottom-up approach that identifies each object first. In the bottom-up approach, we create a small problem first, and try to solve the smaller problem. After solving the smaller program, we will integrate it into a whole subprogram and then to a complete solution to the main program. This approach is mainly used by an object-oriented programming language like C++, Python etc.
In the bottom approach, we specify a small problem and firstly solve it. We can say that all the individual parts of the system are specified in full detail like every individual part we have solved, same as we do in object-oriented programming, we create objects and, finally, we combine the problem, so what we need to do in the bottom-up approach we start to combine all parts of the program. Suppose, there are four parts we combined, it will make another bigger problem and this will be once again combined to solve another larger problem so this is our concept of bottom-up approach same as object-oriented programming we see (e.g.) c++ or java.
So, we can say, in bottom-up approach, we will create smaller programs first with full descriptions, then the smaller programs integrated and linked to other components then these components are linked to form a complete main program. In this program, we will solve the smaller solution and then bring the solution together to create a great program. This approach is used when we have a lot of details about smaller programs, and by using the result, we have to create the main program.
Some specifications of a bottom-up approach
1. Start with small modules and add them together
2. After every step, communication is mandatory
3. Generally used by object-oriented programming
4. Works on the concept of data hiding and encapsulation
5. After every step, checking is important
This approach works when we have enough idea about each section module of a program but have yet to learn of the overall program. This approach mainly focuses on how Data is secure. To put it simply, we use bottom-up, which means we can make programs in small pieces first and then as a block to build a large program.
Approaches in Programming
For developing any software and mobile app, we have mainly three different approaches, which are: The top-down approach, bottom- up approach, and Hybrid.

1. Top-down approach:
In this approach, we develop an overview of the program before developing processes. After that, we create every module with basic prosperity and a basic structure for our project. After creating the basic structure, we work with every individual after that. We work on every individual module. This approach is used when we have a good overall idea of what we need but need more information about each section of our program. In this approach, the problem is divided into small modules. Each problem is analyzed, and the solution of all subproblems is combined to produce the overall result of the program. this process of implementing a structured design is called structure programming
Some characteristics of top-down approaches are given below:
- emphasis is on doing things.
- Large programs are divided into smaller programs known as function.
- Most of the functions share global data.
- Data move openly around the system from function to function.
- no data security.
- transformation of data from one to another.
- In top-down approach addition of new data and function is very difficult.
- this is mainly function-oriented.
- not extensible.
- it follows procedure-oriented programming.
- simple user-defined data types are created.
- programming languages like c, pascal follow this approach.
Advantage of the Top-down approach
- easy to discover an error in a program that is well-analyzed and well designed
- easy to modify a program.
Major drawback of the top-down approach
- we have to solve each module individually even the module is common or not.
- It is the approach used when we have a good idea of the final result, but we have very few details about each section
- this approach is focused on how the task is done.
2. bottom-up approach: It starts with creating small modules in great details all they module in detail,
These modules are then linked to create components, which are then linked to form the complete program. In this approach, we solve the smaller problem first and then bring this solution to create a great program, this is used when we have a lot of details about certain components of the program and we want to build the rest of the program around those components.
Some characteristics of top-down approaches are given below:
- Emphasizes on data rather than procedure
- programming is divided into what is known as objects
- function that operates on the data are tied together in the Data structure
- Data is hidden and cannot be processed by an external function
- data security exists.
- with the help of function, objects may communicate with each other
- new data and functions can be easily added when necessary
- this is mainly data-oriented.
- security of Data is to exist
- extensible
- it follows object-oriented programming, which can create complex user-defined objects
programming languages like c++ java follow this approach.
An object-oriented programming language is an approach that divides a program by creating an object(data + object) that can be used as a template for creating copies of such objects on demands. Object-oriented programming mainly focuses on the security of data.
In this approach, we move bottom to the top of our program. This approach is used when we have enough idea about each section/module of the program but have yet to learn of the overall program.
2. Hybrid approach:
It starts with creating a detailed core of the program with basic modules put together, then we add modules to this core and add functionality to the program. This approach ensures to get a broader vision of the program, like in a top-down approach. And also, the precision in each module is provided by the bottom-up approach. This approach is very balanced and is used instead of the top-down approach when we have a good overall idea and enough details of individual modules.
Why is the bottom approach used in C++?
Yes, C++ follows the bottom approach. The bottom approach divides a complex problem into smaller, easier parts. If these parts are still complex, we further divide these into more manageable, easier tasks and keep repeating this process until we get the easiest parts. By doing this, we get the most basic parts of that complex problem, here easiest tasks are solved or processed first then the result of these easiest parts, we process higher-level tasks and repeat this process with the next higher-level tasks. We get the solution of the main complex,
If we want to store an object's data, we first get that object's most basic details. Then taking those basic details, we keep on processing its further higher-level details according to requirements. We can also do the same tasks in procedural-oriented language, but the object-oriented language could be better for data security.
In an object-oriented language, if we want to store data of students, then we first decide to take the most basic details like no, name, class, fees absents, etc. we get these entries then we can process this Data for getting basic details,, of a student, fees related processing, attendance related processes we can provide the final result of an object.
For example: if we are creating a student management system
in bottom up: We create students, courses, subjects first, and then top-level departments, classes, reports, etc.
In top-down: We create top-level objects like a report, results, etc. then later, students, sources
Now, taking the most basic details of the student object, we reach to complex result-creating process. Object-oriented language provides data security features.