C++ Programming - OOPS Concepts - Discussion

Discussion Forum : OOPS Concepts - General Questions (Q.No. 19)
19.
Which of the following approach is adapted by C++?
Top-down
Bottom-up
Right-left
Left-right
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
27 comments Page 1 of 3.

Kunj patel said:   4 years ago
The declaration has placed after the function made to be called then the main function compiles to be. These were the difference between the C programming and the c++ programming.
(1)

Danh Hoang said:   4 years ago
Structure/procedure-oriented programming languages like C programming language follow top-down approach. Whereas object-oriented programming languages like C++ and Java programming language follow a bottom-up approach.

The top-down approach begins with high-level design and ends with a low-level design or development. Whereas, the bottom-up approach begins with low-level design or development and ends with high-level design.

In the top-down approach, the main() function is written first and all sub-functions are called from the main function. Then, sub-functions are written based on the requirement. Whereas, in a bottom-up approach, code is developed for modules and then these modules are integrated with the main() function.

Nowadays, both approaches are combined together and followed in modern software design.
(9)

Mkoter said:   6 years ago
Usually, in C language, the functions are given priority than the data types. First, the main functionality of the program is discussed and then the subroutines to modularize the code into smaller parts are decided.

Hence it's called the top-down approach.

Raj Kumar Sepat said:   8 years ago
Let's take the example of the main function in C++ if we are defining a class or other functions before the main function, the execution of the program always begin with Main Function, so with this prospective, we can say C++ is a Bottom-up approach.

Sathish said:   9 years ago
The declaration has placed after the function made to be called then the main function compiles to be. These were the difference between the c programming and the c++ programming.

Gelu Menumorut said:   9 years ago
"Approach" is a too general word, like "do", you cannot ask a question "How C++ is doing?", and provide options like top-down, bottom-up, etc.

It's just another inaccurate (by a missing essential detail), in which the word "parsing" or "compiling" should have cleared it much more. People actually answered very specific questions like "what means bottom-up parsing/compiling?" and not the question from the quiz, and probably all gave the impression that they understood the question and answered it well, but that means also that they answered it wrong: if the question is "How is C++ doing?", And you answered "bottom-up", than your answer is wrong, the right answer is "C++ is doing pretty well so far, but nobody knows what's in store for it", and this option was not provided.

Alakya said:   10 years ago
Usually in C language, the functions are given priority then the data types. First the main functionality of the program is discussed and then the subroutines to modularize the code into smaller parts are decided. Hence it's called top down approach.

Sourav Pathak said:   10 years ago
Guys, there is nothing related with main function. Some say that since in c++ program starts executing from main function, so C++ is a bottom up approach.

I was asked the same question in TCS interview and I had also replied the same. The result was that, they slammed me. So go on basics.

Saurabh said:   10 years ago
So, java and c# both follow bottom up approach, right?

U.B.Somasekar said:   1 decade ago
Always the class should under the global region. i.e.above main.


Post your comments here:

Your comments will be displayed after verification.