1.2.4 Types of Programming Language Flashcards Preview

A-Level OCR Computer Science > 1.2.4 Types of Programming Language > Flashcards

Flashcards in 1.2.4 Types of Programming Language Deck (36)
Loading flashcards...
1

Name the four programming paradigms in the specification

Procedural, Object-Oriented, Functional and Declarative

2

How does procedural programming work?

A series of instructions tell the computer how to handle the data given in order to solve the problem.

3

What is structured programming?

A type of procedural programming which utilities the programming concepts of SIRS, Selection, Iteration, Recursion and Sequencing.

4

What data types do procedural languages have available?

Integer, Real, Floating numbers. Characters Boolean and String.

5

What data structures are found in procedural languages?

Arrays and records, however programmers can abstract their own data types such as stacks, queues, trees or a hash table.

6

What is a class?

A class is a template description of the methods and variables available within the objects produced from said class.

7

What is a object?

A object is a instance of a class.

8

What are the three defining features of OOP?

Inheritance, Polymorphism and Encapsulation.

9

What is inheritance?

Inheritance is the ability of a class to take attributes from another, when a class does this it is a sub class and the class the attributes were taken from is a super class.

10

What is polymorphism?

The ability of the programming language to differentiate between objects based on their class.

11

What is encapsulation?

The bundling of data and methods that operate on said data.

12

What are three advantages of OOP?

OOP methodology forces programmers to undertake extensive planning which makes for better design less prone to bugs.

Re usability, Objects defined, coded and tested can be reused in many different programs.

Maintenance, The modular structure of OOP makes it easier to maintain than other paradigms.

13

What is functional programming?

Functional programming is where statements are written as a series of functions where data input is taken as arguments and a output is produced.

14

What is declarative programming?

Where the programmer outlines the problem in statements and the programming language decides how best to solve said problem.

15

Give an example of a language that supports each programming paradigm.

Procedural - Python, Pascal
Object orientated - Java,Python,Delphi
Declarative - SQL
Functional - Haskell,Python,C#,Java.

16

How does an assembly language work?

Operation codes and addresses are represented using mnemonics, the assembler translates these into machine code for execution.

17

Name all four addressing modes.

Indexed addressing
Direct addressing
Immediate addressing
Indirect addressing

18

Explain indexed addressing.

Indexed addressing is when the operand contains the number of the index register and the constant value, the constant value is added to the index register in order to find the address of the data to be operated on.

19

What is immediate addressing?

When the operand holds the data to be operated on.

20

What is direct addressing?

When the operand holds the address of the data to be operated on.

21

What is indirect addressing?

When the operand holds the address of the memory location where the address of the data to be operated is.

22

Give an example of application for procedural programming.

Procedural - Educational due to it being easy to learn and widely applicable to many problems.

23

Give an example of application for declarative programming.

Artificial intelligence.

24

Give an example of application for functional programming.

Machine learning.

25

Give an example of application for Object orientated programming.

Simulation and modelling systems.

26

Write down a LMC program that inputs three numbers and calculates their sum.

INP
STA 1
INP
STA 2
INP
ADD 1
ADD 2
OUT
HLT

27

What does LDA do

Loads the value held at said memory location into the accumulator.

28

What does STA do

Stores in the value in the accumulator in the given memory location.

29

What does HLT do

Halts the program.

30

What is a dynamic data structure?

A data structure that can increase or shrink in size. For example and Linked list or a queue.