levo

Types of Programming Language

Programming paradigms and procedural languages

  • 3 things to know
  • Component 01

Overview

Recall questions on programming paradigms and why more than one is needed, procedural languages and their features, object-oriented, declarative, functional, logic and event-driven paradigms, low-level languages, and multi-paradigm languages.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Key term

Name three features you would expect to find in a procedural language.

Key term

What characterises a declarative paradigm, and how does it differ from an imperative one?

Key term

What characterises the logic paradigm?

Questions from this subtopic

Each one with the model answer underneath.

  1. 1

    What is a programming paradigm?

    Model answer

    A style or approach to programming - a whole way of thinking about how a program should be organised and what a program fundamentally is. It determines how the problem is broken down, how data and instructions are represented and how the flow of the program is controlled, rather than merely which keywords are typed.

  2. 2

    Why is there a need for more than one programming paradigm?

    Model answer

    Different kinds of problem have different natural shapes, and a paradigm that fits the shape of the problem produces code that is shorter, clearer and less likely to be wrong. Controlling a machine step by step suits a procedural approach; modelling a system of interacting real-world things suits objects; expressing a set of facts and rules and letting the machine search suits a declarative approach; responding to unpredictable user actions suits an event-driven one. Hardware and the size of projects have also changed over time, and paradigms developed to manage the growing complexity.

  3. 3

    What characterises the procedural paradigm?

    Model answer

    The program is a sequence of instructions telling the computer step by step what to do, in a stated order, using the three basic constructs of sequence, selection and iteration. Data is held in variables that the instructions read and change, and the instructions are grouped into procedures and functions that can be called from elsewhere. It is imperative: the code says how the task is to be carried out.

  4. 4

    Name three features you would expect to find in a procedural language.

    Model answer

    Variables and data types for storing values; the control constructs of sequence, selection and iteration; subroutines - procedures and functions - with parameters and local variables; and usually arrays and other structured data types. Examples of procedural languages include C, Pascal and Python used in a procedural style.

  5. 5

    What characterises the object-oriented paradigm?

    Model answer

    The program is organised as a set of objects that each bundle together their own data and the operations that act on it, and that interact by calling one another's methods. Objects are created from classes, which act as templates, and classes can inherit from other classes. Data is deliberately hidden inside objects rather than being globally available.

  6. 6

    What characterises a declarative paradigm, and how does it differ from an imperative one?

    Model answer

    A declarative program states what is wanted rather than how to obtain it, leaving the system to work out the steps. An imperative program - procedural or object-oriented - spells out the sequence of operations. A database query that asks for all customers in a given town is declarative; a loop that examines each record in turn and adds the matching ones to a list is imperative.

Other ways to work this

The same content, four other ways.

What is inside Levo

Six ways to work the same material.

1Closed book
2Open book
3Closed book

The 3-step method, run for you

Answer cold, learn it, then prove it stuck. Levo tracks the jump between your first attempt and your last.

Processors: Structure, Performance and Types
Input, Output and Storage
Systems Software
Applications Generation

Cram a whole paper in one sitting

Sort every topic into what you know and what you do not, then drill only the weak ones.

If it matches, the search .
succeedsfailsrestarts

Blank Blitz makes facts automatic

Rapid timed gap-fills on the terms and numbers you need to recall without thinking.

A0 + 0 gives 0.
B0 + 1 gives 1.
C1 + 1 gives 0 carry 1.

Build It gets the exam shape right

Assemble a full-mark answer from its marking points, in the order an examiner wants them.

A global variable means a variable reachable from anywhere in the program.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The traps are the mistakes students actually make.

721941163128510

Brain Breaks between sessions

Short focus games to reset attention, so the next set lands better than the last.

Every question in Types of Programming Language, on a schedule.

Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.

Or £46 a year, about £3.83 a month. Cancel anytime.