Programming Paradigms Flashcards Preview

AH Computing > Programming Paradigms > Flashcards

Flashcards in Programming Paradigms Deck (41):
1

What are the three basic control structures?

Sequence
Selection
Iteration

2

Describe the features of Imperative Programming

Set of commands which can be called by name
Pass parameters between blocks of code
Modularity

3

Give two advantages of modular coding

- Can be tested independently of the main program
- Can be re-used within the program
- Split up large programming problems
- Makes code more readable

4

List the main features of Object Orientated Programming

Classes
Objects
Methods
Encapsulation
Instance Variables
Inheritance

5

What can be used to describe a class?

Class Diagram

6

What is Instantiation?

Creating an object from a class(blueprint) that is already defined

7

Give a benefit of inheritance

Once a class has been defined and tested, sub-classes can then be created which share the main characteristics of parent class
-Saves testing and development time

8

What is the ability to redefine methods in object orientated programming?

Polymorphism

9

Describe what happens in Concurrent Programming

Several streams of operations may execute simultaneously

10

Describe a 'race condition'

When two threads both try to change the value of a variable simultaneously resulting in unpredictable results

11

What is it called when two threads are competing for the same resource resulting in neither of them completing their operations?

Deadlock

12

What is done to prevent race conditions occurring?

Placing a lock on shared data so only one thread can access it at a time

13

What is resource starvation?

Priority is constantly given to one thread, preventing other lower priority threads accessing the data needed for completion

14

What is resource starvation caused by?

Poor scheduling
Prioritizing

15

What is concurrency control?

Ensuring operating happens in the correct order and access to resources is co-ordinated so they are shared among threads according to their priority

16

State some advantages of concurrent programming

A user can interact with applications while other tasks are running
Long running tasks need not delay short running ones
Complex programs can make better use of multiple resources in multi core processors

17

Concurrent programming is a feature in what type of languages?

Declarative
Object Orientated

18

Give examples of languages designed with concurrent programming in mind

Java, Salsa

19

The role of setting up groups of program instructions as threads to run concurrently is managed by?

Translation software

20

In what environment is concurrent programming particularly relevant to?

Multi Core Processor Architecture

21

What can the three main control structures be combined to form?

More powerful computational constructs

22

What does imperative programming focus on?

Describing how a program operates

23

Define 'Sequence'

One command is executed followed by another

24

Define 'Selection'

If a condition is true then one command is executed else if the condition is not true then another command is executed

25

Define 'Iteration'

Repetition

26

What is the difference between formal and actual parameters?

Formal - In the subroutine definition
Actual - In the subroutine call

27

What is declarative programming?

Programming paradigm that describes the desired results without listing the steps to be performed

28

What is Object Orientated Programming?

A style of programming allowing a program to be separated into blocks of related data, and the operations which apply to that data

29

What is a Class?

Definitions for the data format and the avaliable procedures for a given type of object
(Blueprint for an object)

30

What is an Object?

Instance of a class, block of related data and the operations which apply to that data

31

Who can access the data in an object?

Associated Operations of the Class

32

What is Inheritance?

Sharing of characteristics between a super class and a newly created subclass, where subclass inherits all the methods and variables from super class and can add it's own as well

33

What is Encapsulation?

Bundling of data with methods that operate on that data
Hides the values of data within class, can only be accessed by methods of that object

34

What is a benefit of encapsulation?

Allows you to change part of the code without affecting other parts
Prevents unintended changing of data

35

What is Polymorphism?

When you can treat an object as a generic version of something, but when accessing it, the code determines which exact type it is and calls the associated code.

36

What is a stream of data called in concurrent programming?

Thread

37

What is a disadvantage of concurrent programming?

Code is difficult to write and debug

38

What are scripting languages typically used to do?

Add extra functionality or automate an application program/operating system

39

What is a macro?

Sequence of operations that can be invoked as a single task

40

What are Domain Specific Languages?

Subset of procedural languages that have been designed with one specific type of task in mind

41

Give an example of a domain specific language and what is was designed for?

SQL which was designed to formulate database queries