Match List I with List II Choose the correct answer from the options given below :List I List II (Programming Paradigm) (Characteristic) A. Imperative I. Declarative, clausal representation, theorem proving B. Object‐oriented II. Side‐effect free, declarative, expression evaluation C. Logic III. Imperative, abstract data type D. Functional IV. Command‐based, procedural
A ‐ IV, B ‐ III, C ‐ I, D ‐ II
Programming paradigms are different ways of classifying programming languages based on their features. They represent fundamental approaches to building software. Let's analyze each paradigm and its characteristics presented in the question.
The question asks us to match Programming Paradigms from List I with their corresponding Characteristics from List II.
List I: Programming Paradigm
List II: Characteristic
Let's examine each programming paradigm and find its best match from the characteristics:
Based on the analysis, the correct matches are:
Let's represent this in a table format:
| Programming Paradigm (List I) | Characteristic (List II) | Match |
|---|---|---|
| A. Imperative | IV. Command‐based, procedural | A ‐ IV |
| B. Object‐oriented | III. Imperative, abstract data type | B ‐ III |
| C. Logic | I. Declarative, clausal representation, theorem proving | C ‐ I |
| D. Functional | II. Side‐effect free, declarative, expression evaluation | D ‐ II |
The correct matching is A − IV, B − III, C − I, D − II.
| Paradigm | Key Characteristics | Example Languages |
|---|---|---|
| Imperative | State change, sequence of commands, mutable data, procedural calls | C, C++, Java, Python (often used imperatively) |
| Object‐oriented | Objects, classes, encapsulation, inheritance, polymorphism, abstract data types | Java, C++, Python, C# |
| Logic | Declarative, facts, rules, queries, unification, backtracking, theorem proving | Prolog |
| Functional | Declarative, pure functions, immutability, expression evaluation, recursion, higher-order functions | Haskell, Lisp, Scheme, Scala (supports functional) |
Understanding the distinction between declarative and imperative paradigms is crucial:
Object-oriented programming is typically built on an imperative foundation but adds structure through objects and classes. Some modern languages support multiple paradigms, allowing programmers to combine imperative, object-oriented, and functional styles within the same program.
Let A be the base class in C++ and B be the derived class from A with protected inheritance. Which of the following statement is false for class B?
A member function can always access the data in _______, (in C++).
Which of the following is not correct for virtual function in C++?
Which of the following is correct (in C++)?
Which statements is correct regarding main () function in C++?
I. It is a user defined function.
II. It is a pre-defined function.