Week 10 Flashcards

1
Q

Embedded object known as?

A

nested object. almost like inheritance when embedding an object into a class

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

multiple inheritance?

A
inherit features from more than one base class.
syntax: class child: public father, public mother{};
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

modes of operation for multiple inheritance?

A
  1. multiple inheritance with a common grandparent is known as repeated inheritance
  2. repeated inheritance with separate copies of the grandparent is known as replicated inheritance while repeated inheritance with a single copy of the grandparent is known as shared inheritance
  3. the default in c++ is replicated inheritance
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

problems of multiple inheritance?

A
  1. semantik yang ambigu karena memiliki nama yang sama dalam parent class
  2. nama yang sama dapat digunakan pada method yang berbeda dalam base class
  3. kedua base class boleh memiliki method yang sama, sehingga tidak dapat mengetahui method yang mana yang sedang berjalan
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Composition adalah?

A

cara untuk mengabungkan objek kedalam objek yang lebih complex. memiliki relationship “has a”. contohnya mobil dengan objek ban, stir, seat, gear dan mesin.

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

Aggregation adalah?

A

beda dengan composition. jika ada satu objek di destroy. functionality dari sebuah program dapat tetap berjalan.

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

class template dikenal juga?

A
generic class
class generator 
parameterized class
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

perbedaan OOP dan generic programming?

A

OOP:

  1. actual parameter harus diperolah dari formal parameter
  2. harus pake virtual member
  3. dapat menunda pemilihan function sampai run-time

Generic:

  1. parameter hanya dibutuhkan utk implementasi method
  2. dapat menggunakan inline
  3. type must be known at compile-time
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what is container and jenis-jenis container:

A

container adalah pemegang dari objek yang menyimpan sebuah koleksi dari objek lain (elemennya).

  1. sequence container (vector, list, dequeue)
  2. associative container (sets, multisets, maps, multimaps, bitset)
  3. container adapter (stack, queue, priority queue)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Iterator?

A
digunakan sebagai argument pada algoritma utk akses data.
5 kategori:
1. input iterator
2. output iterator
3. forward iterator
4. bidirectional iterator
5. random access iterator
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

jenis klasifikasi algorithm?

A
  1. non-modifying algorithms
  2. modifying algorithms
  3. numeric algorithms
  4. heap algorithms
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

what is orthogonality?

A

desain programming language yang memiliki kemampuan untuk menggunakan bervariasi fitur yang berubah-ubah dengan hasil yang konsisten

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

what is template?

A

an abstract recipe for producing concrete code

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

what is instances?

A

actual functions and classes yang digenerated

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

relationship dari Compisition?

A

has-a

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