Types Of Programming Language Flashcards

1
Q

Programming paradigm

A

Different approaches to using a programming language to solve a problem
(To describe an example of a way of doing things)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Turing complete language

A

Can solve all the problems that a computer is able to solve

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the need for different programming paradigms

A

We need different programming paradigms because some problems are better suited to being solved using a certain paradigm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Machine code

A

Least abstract
Closest to what actually happens on a computer
These translate into matching electrical signals
Programs directly into 1’s and 0’s

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Assembly language

A

Uses short code words (mnemonics)
Each mnemonic matches a specific sequence of 1’s and 0’s
Written in assembly language and translated by a specific assembler
One to one relationship

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

High level languages

A

The first languages that could go further than machine code and assembly language were developed in the early 1950s
These languages had a one to one relationship as each instruction could translate to many lines of machine code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Imperative languages

A

Use statements that change a programs state in the form of sequence, selection, iteration. Consists of commands for a computer to perform and focus on describing how a program operates

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Declarative languages

A

Focus on what the program SHOULD accomplish

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Sublevel of high level languages

A

Declarative
Imperative

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Types of imperative

A

Object oriented
Procedural

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Type of declarative

A

Logic
Functional

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Object oriented

A

Modern extension of the imperative programming approach that focuses more on a modular approach to programming

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Procedural

A

Type of imperative programming paradigm where a program is built from one or more subroutines

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Advantages of machine code and assembly language

A

Assembly language has the same efficiency of execution as machine code due to its one to one nature
It can produce very precise, locally optimised and efficient code
It provides direct access to system level features without having to go through a software interface- this improves the speed of the program
In complete control of your code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Disadvantages of machine code and assembly language

A

It is machine dependant and code is very hard- if not impossible - to port
programmers who can write efficient assembly code are rare- which is one of the reasons why high level languages were produced in the first place
Even in the hands of a talented programmer code can be tedious to write and very prone to bugs
The code can be difficult to understand therefore it can also be hard to modify and maintain

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Features of procedural programming paradigms

A

Sequence, selection, iteration

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

procedural programming paradigms data

A

Stored in local and global variables and accessible to other parts of the program using parameter passing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

procedural programming paradigms structure

A

Procedures and function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

procedural programming paradigms logic

A

Expressed in a series of procedure calls

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Features of object oriented paradigms

A

Sequence, selection, iteration plus inheritance, objects, classes and encapsulation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

object oriented paradigms data

A

Stored in attributes and concealed from other parts of the program via encapsulation

22
Q

object oriented paradigms structure

A

Classes, methods and instances

23
Q

object oriented paradigms logic

A

Based on models and behaviours

24
Q

Procedural language programming features

A

Variables
Constants
Selection
Iteration
Sequence
Subroutines
String handling
File handling
Operators
Arrays

25
Q

How is code developed (procedural)

A

Developed in a modular way. Blocks of code identify set tasks that need to be completed. Use procedures and functions to achieve this

26
Q

What do procedural languages focus on

A

Focus on telling a computer exactly what to do by way of step by step instructions

27
Q

Types of addressing memory methods

A

Immediate
Direct
Indirect
Indexed

28
Q

Immediate addressing

A

Immediate operand, the value in the address part of the instruction is actually the value to be used, so the memory does not need to be searched to find the required value

29
Q

Direct addressing

A

The value in the address part of the instruction is a reference to the address in memory where the required value is located

30
Q

Indirect addressing

A

The value in the address part of the instruction is a reference to a memory location that contains the address in memory where the required value is located

31
Q

Indirect addressing (usefulness)

A

This mode of addressing memory is incredibly useful, as it means larger address ranges can be used to reference data and instructions

32
Q

Indexed addressing

A

More efficient to use an index register (IR)
The IR is set to 0 so first value is taken from 0 + memory address
The IR is incremented and the same instruction is used again
Why an array needs to be stored in contiguous memory locations. Store address for element 0 of the array in the index register then increment

33
Q

Constructor method

A

A special method within the class that runs when an object of the class type is created
When the object is created the constructor method takes the values of the parameters passed into the class object and sets its local attributes to their initial values

34
Q

Three main sections of classes

A

The name of the class
It’s attributes- variables
Its methods- subroutines

35
Q

Class

A

A class is a blueprint used to set or define what attributes and methods an object of a certain type should have. A class is not an object. (Every object from that class looks the same)

36
Q

Object

A

An instance of a class which contains both properties and behaviours within it

37
Q

Instantiation

A

The process of creating an object from a class template

38
Q

Inheritance

A

Allows a class to share the properties (attributes) and behaviours (methods) of another class

39
Q

Overriding

A

Occurs automatically when you call a method from an object that shares the same name as a method further up the class tree.
The overriding method takes place and replaces the method from the superclass

40
Q

super<dot>prefix.</dot>

A

When using super<dot>prefix. overriding is ignored and the method from the original superclass is used instead</dot>

41
Q

Encapsulation

A

The bundling of data with the methods that operate on and restrict direct access to it
Used to hide the values or internal state of an object, preventing direct access by unauthorised parties
Encapsulated attributes of an object should only be accessible or changeable via the methods provided by the object
Helps keep the data related to an object safe- programmer stays in control

42
Q

Accessing private attributes (encapsulation)

A

Other instantiated objects are prevented from directly accessing or altering the objects private attributes (like local variables) without going through its methods first
Any attempt to directly access an objects private attributes will result in an error
You must supply methods if you want an objects internal attributes to be read or altered
An objects methods are usually set to public, not private
As the methods are part of the same objects as its private attributes it will be able to access them

43
Q

Polymorphism

A

Something that occurs in several different forms

44
Q

Two types of polymorphism

A

Static
Dynamic

45
Q

Static polymorphism

A

Allows you to implement multiple methods of the same name, but with different parameters, within the same class- method overriding

46
Q

Parameter sets must differ in one of three ways (static polymorphism)

A

They need to have a different number of parameters
The types of parameters need to be different
Need to expect the parameters in a different order

47
Q

Inheritance hierarchy

A

Subclass is able to override method of its superclass
It is a form of polymorphism and it provides different functionality depending on whether they are implemented by the superclass or the subclass

48
Q

When should you use object oriented techniques

A

OOP works best in situations where you can encapsulate and model entities as objects. This allows you to define objects as classes and better understand and how they relate to and interact with each other

49
Q

How does OOP relate to GUI

A

Good way to develop Graphical User Interface
Developed in parallel with the first GUI

50
Q

Operand

A

Contains value

51
Q

Opcode

A

Basic machine operation