All Exams Test series for 1 year @ ₹349 only
Question

Match List I with List II

List IList II
(Programming Paradigm)(Characteristic)
A.ImperativeI.Declarative, clausal representation, theorem proving
B.Object‐orientedII.Side‐effect free, declarative, expression evaluation
C.LogicIII. Imperative, abstract data type
D.FunctionalIV.Command‐based, procedural

Choose the correct answer from the options given below :

The correct answer is

A ‐ IV, B ‐ III, C ‐ I, D ‐ II

Understanding Programming Paradigms and Characteristics

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

  • A. Imperative
  • B. Object‐oriented
  • C. Logic
  • D. Functional

List II: Characteristic

  • I. Declarative, clausal representation, theorem proving
  • II. Side‐effect free, declarative, expression evaluation
  • III. Imperative, abstract data type
  • IV. Command‐based, procedural

Matching Programming Paradigms with Characteristics

Let's examine each programming paradigm and find its best match from the characteristics:

  • A. Imperative Programming: This paradigm is centered around commands that change the program's state. Programs consist of a sequence of instructions that the computer executes. This is essentially "command-based" and often "procedural" (using procedures or functions to structure code). Characteristic IV - "Command‐based, procedural" - perfectly describes imperative programming.
  • B. Object‐oriented Programming (OOP): While OOP can be built upon imperative principles, its core concepts involve objects, classes, encapsulation, inheritance, and polymorphism. Objects combine data and the operations (methods) that act on that data, which relates closely to the concept of an "abstract data type". Characteristic III - "Imperative, abstract data type" - captures the essence of OOP being often imperative at its base while focusing on abstract data types.
  • C. Logic Programming: This paradigm views computation as logical deduction. Programs are sets of logical statements (facts and rules) from which queries are answered using theorem proving techniques. It is "declarative" as you describe the problem, not the steps to solve it. It uses "clausal representation" (like Horn clauses in Prolog) and relies on "theorem proving" mechanisms. Characteristic I - "Declarative, clausal representation, theorem proving" - is a precise description of logic programming.
  • D. Functional Programming: This paradigm treats computation as the evaluation of mathematical functions. It emphasizes immutability and avoids changing state or mutable data, leading to "side‐effect free" functions. It is "declarative" because the focus is on defining *what* to compute rather than *how* to compute it using sequential commands. Computation proceeds primarily through "expression evaluation". Characteristic II - "Side‐effect free, declarative, expression evaluation" - accurately describes functional programming.

Summary of Matches

Based on the analysis, the correct matches are:

  • A. Imperative ‐ IV. Command‐based, procedural
  • B. Object‐oriented ‐ III. Imperative, abstract data type
  • C. Logic ‐ I. Declarative, clausal representation, theorem proving
  • D. Functional ‐ II. Side‐effect free, declarative, expression evaluation

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.

Revision Table: Programming Paradigm Characteristics

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)

Additional Information: Declarative vs. Imperative

Understanding the distinction between declarative and imperative paradigms is crucial:

  • Imperative: Focuses on *how* to perform a computation. You provide a sequence of steps or commands that modify the program's state to achieve the desired result. Think of it like giving step-by-step instructions.
  • Declarative: Focuses on *what* the computation should achieve, without specifying the explicit control flow or steps. You describe the desired result or the logic, and the system figures out how to get it. Logic programming and Functional programming are largely declarative.

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.

Was this answer helpful?

Important Questions from OOPs concept

  1. 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?

  2. Which of the following statements are true regarding C++?

    (a) Overloading a function gives the capability to an existing operator to operate on other data types.

    (b) Inheritance in object-oriented programming provides support to reusability.

    (c) When object of a derived class is defined, first the constructor of derived class is executed then constructor of a base class is executed.

    (d) Overloading is a type of polymorphism.

    Choose the correct option from those given below:
  3. A member function can always access the data in _______, (in C++).

  4. Which of the following is not correct for virtual function in C++?

  5. Which of the following is correct (in C++)?

Need Expert Advice?

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App