TK Study

Multiple choice › Programming paradigms

Programming paradigms

1. Programming paradigms

Which paradigm describes a program as a sequence of statements that change state, using procedures?

  1. Functional
  2. Declarative database query
  3. Logic
  4. Imperative
Answer

D

Imperative/procedural = step-by-step commands. Logic programs state facts and rules; functional programs compose functions without side effects.

2. Programming paradigms

Which statement is correct about the logic paradigm?

  1. Programs consist of facts and rules and the system works out answers by inference
  2. Programs avoid using any data
  3. Programs are only sequences of assignment statements
  4. Programs are made of objects with methods
Answer

A

Logic programming (e.g. Prolog) uses facts, rules and queries.