programming techniques?? Flashcards

1
Q

Imperative programming

A

uses a series of instructions telling comp what to do w/ input in order to solve problem

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

Procedural programming

A

uses a sequence of
instructions which may be contained within procedures.
These instructions are carried out in a step-by-step manner

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

Structured programming

A

a kind of procedural programming which uses constructs: selection, sequence, iteration + recurssion rather than ‘go to’ stattements.

Modular techniques used to split large program intoo manageable chunks

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

Declarative programming

A

statements describe prolem to be solved.
language implementation then finds best way of solving it
used to create, amend + query databases

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

Logic programming

A

form of declarative programming.
is a paradigm expressing logic of computation w/o expressing control flow
consist of logical statements
code defines a set of facts and rules

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

What is an inportant feature of declarative programming

A

backtracking

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

whats used to find answers to problems in logic programming

A

queries

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

what uses procedural programming

A

python, basic, pascal, c#

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

what uses oop

A

java, c++, visual basic.NET, python

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

what uses declarative programming

A

sql, prolog

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

what uses functional programming

A

haskell, javascript, logo

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

define backtracking

A

going back to a previously found successful match

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

3 important things in declarative programming

A

facts and rules and goal

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

facts in declarative programming

A

a predicate which may have arguments + is something unconditionally true

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

rules in declarative programming

A

used to define a relationship b/w facts.

stored in the knowledge base.

true depending on given condition

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

goals in declarative programming

A

query to b solved

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

def instantiation

A

process of creating a new object from a class

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

advantages imperative programming

A

Very simple to implement
It contains loops, variables

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

disavantage imperative progrmaming

A

Complex problem cannot be solved
Less efficient and less productive
Parallel programming (parallel processing) is not possible

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

Imperative programming is divided into three broad categories which are?

A

Procedural, OOP and parallel processing

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

oop is

A

a collection of classes and object which are meant for communication.

The smallest and basic entity is object and all kind of computation is performed on the objects only.

More emphasis is on data rather procedure. ??

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

oop advantages

A

Data security
Inheritance
Code reusability
Flexible and abstraction is also present

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

declaative programming divided into?

A

logic, functional, database

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

what does the paradigm used depend on

A

problem to be solved

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

abstraction in declarative programming

A

how the data is obtained is abstracted from user

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

can procedural programming solve all problems

A

no

or is inefficient

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

is abstraction used in oop

A

ya

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

what is code in oop designed for

A

reusability + easy maintenance

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

how is oop reusable

A

templates are used to create instances of objects

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

what do classes in oop have

A

attributes and methods

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

how is oop easy to maintain

A

if an error in the methods, easy to locate where error is

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

what d objects have

A

data - attributes
operations on that data - methods

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

all processing in oop is used on

A

objects

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

def class

A

blueprint of an object
defines attributes + methods that capture common characteristics + behaviours of the object

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

whats a constructor

A

a special method creating an object based on the class

exist in every class

new(attributes)

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

encapsulation def

A

Is the process of data hiding by keeping an object’s attributes private so their
values can only be directly accessed and changed via public methods defined for the class and not
from outside the class. This means that objects only interact in the way intended and prevents
unexpected changes to attributes, maintaining data integrity

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

inheritance def

A

Is when a derived class inherits all the methods and attributes of its parent
class/superclass.

The inheriting class may override some of these methods and attributes and may also have additional extra methods and attributes of its own.

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

‘is a’ rule

A

is obj a an obj b

used to determine if inheritance appropritate

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

Polymorphism def

A

allows objects of different classes to be treated as objects of a common superclass or interface

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