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
abstraction in declarative programming
how the data is obtained is abstracted from user
25
can procedural programming solve all problems
no or is inefficient
26
is abstraction used in oop
ya
27
what is code in oop designed for
reusability + easy maintenance
28
how is oop reusable
templates are used to create instances of objects
29
what do classes in oop have
attributes and methods
30
how is oop easy to maintain
if an error in the methods, easy to locate where error is
31
what d objects have
data - attributes operations on that data - methods
32
all processing in oop is used on
objects
33
def class
blueprint of an object defines attributes + methods that capture common characteristics + behaviours of the object
34
whats a constructor
a special method creating an object based on the class exist in every class new(attributes)
35
encapsulation def
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
36
inheritance def
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.
37
'is a' rule
is obj a an obj b used to determine if inheritance appropritate
38
Polymorphism def
allows objects of different classes to be treated as objects of a common superclass or interface
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103