Intro to OOP Flashcards

1
Q

First OOP Language, introduced
object-oriented programming concepts
such as object, class,
etc.

A

SIMULA (Simulation Language)
Creators: Ole-Johann Dahl and Kristen Nygaard
Fathers of Object Technology

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

led a team that developed
Smalltalk at Xerox PARC
- inspired by Simula,
- Coined the term “Object
Oriented Programming”

A

Alan Kay

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

implemented “C with Classes” aka C++ - Became the most widely used OOP language

A

Bjarne Stroustrup

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

developed Java (former name is Oak)
- Simplified C++

A

James Gosling

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

4 Approaches to Software Development

A

Top-Down Programming
Bottom-Up Programming
Modular Programming
Structured Programming

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

the programmer decides what major actions the program
must take

rather than worry about the details of how it is done, the
programmer defines a function that will handle that
later

A

Top-Down Programming

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

starts by defining a simple function that might be useful in
solving a more complex problem

A

Bottom-Up Programming

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

4 Main Python Coding Styles

A

Imperative
Functional
Object-oriented
Procedural

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

Like math: treats everything like a math equation
Make use of higher-order functions for data manipulation

A

Functional Style

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

focus is on how a program operates. Changes the state information as needed in order to achieve a goal

A

Imperative Style

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

What Coding style does this code snippet exemplify:

sum = 0
for x in my_list:
sum += x
print(sum)

A

Imperative Style

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

coding is all about increasing an application’s ability to reuse code and make it easier to understand

A

Object-Oriented Programming

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

What Coding style does this code snippet exemplify:

class ChangeList(object):
def __init__(self, any_list):
self.any_list = any_list
def do_add(self):
self.sum = sum(self.any_list)
create_sum = ChangeList(my_list)
create_sum.do_add()
print(create_sum.sum)

A

Object Oriented Programming

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

The __________________ relies on procedure calls to create modularized code. This approach simplifies your application code by breaking it into small pieces that a developer can view easily.

A

Procedural Style

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

POP vs OOP

Program Subparts: Functions

A

Procedural Oriented Programming

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

POP vs OOP

Program Subparts: Objects

A

OOP

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

POP vs OOP

Prioritizes functions as well as sequence
of actions to be done

A

POP

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

POP vs OOP

Prioritizes data

19
Q

POP vs OOP

Top-down Approach

20
Q

POP vs OOP

Bottom Up Approach

21
Q

POP vs OOP

No access modifiers

22
Q

POP vs OOP

Has access modifiers (ie. public, private, protected, default)

23
Q

POP vs OOP

Data can move freely
from function to
function in the system

24
Q

POP vs OOP

Objects can move and communicate
with each other through member
functions

25
Q

POP vs OOP

To add new data and function is not so
easy

26
Q

POP vs OOP

Can easily add new data and function

27
Q

POP vs OOP

Most function uses Global data for sharing that can be
accessed freely from function to function in the system

28
Q

POP vs OOP

Data can not move
easily from function to
function,it can be kept
public or private so
we can control the
access of data

29
Q

POP vs OOP

does not have any
proper way for hiding
data so it is less
secure

30
Q

POP vs OOP

provides Data Hiding
so provides more
security

31
Q

POP vs OOP

Overloading is not
possible

32
Q

POP vs OOP

Overloading is
possible in the form of
Function Overloading
and Operator
Overloading

33
Q

is a paradigm that uses classes and objects to create models based on the real-world environment.

A

Object-Oriented Programming (OOP)

34
Q

Defines attributes (or properties) and behavior
and dictates the concept

35
Q

Instances of Classes

36
Q

A way for the programming language
to represent real-world objects as software
objects

37
Q

is when we forget about details of how something works and just
concentrate on using it. Devil is in the details :>

A

Abstraction

38
Q

Data hiding. A Class can have properties that cannot be accessed directly

A

Encapsulation

39
Q

employs the use of Parent and Child classes (Super and Subclasses)

A

Inheritance

40
Q

Use of a class exactly like its parent so there’s no confusion with mixing types. But each child class keeps its own methods as they are.

A

Polymorphism

41
Q

Focuses on the essentials and ignores the irrelevant

A

Abstraction

42
Q

Denotes the essential characteristics of an object that distinguish it from all other kinds of objects providing well-defined boundaries, relative to the perspective of the viewer

A

Abstraction