Multiple choice › Programming paradigms
Programming paradigms
1. Programming paradigms
Which paradigm describes a program as a sequence of statements that change state, using procedures?
- Functional
- Declarative database query
- Logic
- 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?
- Programs consist of facts and rules and the system works out answers by inference
- Programs avoid using any data
- Programs are only sequences of assignment statements
- Programs are made of objects with methods
Answer
A
Logic programming (e.g. Prolog) uses facts, rules and queries.