Choose the best matching between the programming styles in Group 1 and their characteristics in Group 2.
View worked solution
Answer: D
We can match each programming paradigm in Group 1 with its defining characteristics in Group 2:
- P. Functional Programming 3. Side-effect free, declarative, expression evaluations
Functional programming (e.g., Haskell, Lisp) treats computation as the evaluation of mathematical functions. It avoids state changes and mutable data, making it side-effect free. - Q. Logic Programming 4. Declarative, clausal representation, theorem proving
Logic programming (e.g., Prolog) is declarative and expresses programs in terms of relations and logical clauses (like Horn clauses). Execution is driven by a system of theorem proving. - R. Object-oriented Programming 2. Imperative, abstract data types
Object-oriented programming (e.g., C++, Java) builds upon the imperative paradigm by encapsulating state and behavior into classes, which represent abstract data types. - S. Imperative Programming 1. Common-based, procedural
Imperative programming (e.g., C, Pascal) is command-based (procedural), where the program consists of explicit instructions that change the program state.
Thus, the correct matching is P-3, Q-4, R-2, S-1, which corresponds to Option D.
Free practice · Your answers on this page are not saved.
