Describe what is meant by an imperative (procedural) programming language.
- (a)Describe what is meant by an imperative (procedural) programming language.[2]
- (b)Describe what is meant by a declarative programming language.[2]
- (c)Identify the programming paradigm for each of these program code examples. Program code example male (john). female (ethel). parent (john, ethel). FOR Counter = 1 TO 20 X = X * Counter NEXT Counter Start: LDD Counter INC ACC STO Counter public class Vehicle { private speed; public Vehicle() { speed = 0; } } Programming paradigm[4]
Mark scheme
Marking points from the official mark scheme (May/June 2021). The mark or mark type is shown in brackets.
- [1] (a) Imperative languages use variables
- [1] (a) ... which are changed using (assignment) statements
- [1] (a) ... they rely on a method of repetition / iteration.
- [1] (a) The statements provide a sequence of commands for the computer to perform
- [1] (a) ... in the order written / given
- [1] (a) ... each line of code changes something in the program run.
- [1] (b) Instructs a program on what needs to be done instead of how to do it
- [1] (b) ... using facts and rules
- [1] (b) ... using queries to satisfy goals.
- [1] (b) Can be logical or functional
- [1] (b) Logical - states a program as a set of logical relations
- [1] (b) Functional - constructed by applying functions to arguments / uses a mathematical style
- [1] (c) Program code 1 (male(john).): Declarative
- [1] (c) Program code 2 (FOR Counter = 1 TO 20): Procedural / imperative
- [1] (c) Program code 3 (Start: LDD Counter): Low-level / assembly
- [1] (c) Program code 4 (public class Vehicle): Object oriented / (OOP)
Write your answer and get it marked
On Oracle Prep you can write or photograph your own answer and have it marked by AI against this mark scheme, with feedback on what you missed.
Sign up free →