section c Flashcards

1
Q

name of identifier

A

playgame

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

why is playgame public not private

A

allows it to be accessed from outside the class but the main functions, wouldn’t be possible if it was private

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

how many points do you lose if you choose moves 1, 2 and 3?

A

1
4
7
this shit basic asl

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

how do u modify grid size?

A

modify the line where Dastan is initialised with 6 6 4

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

instance of inheritance

A

kotla inherits from square

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

name of an identifier for a PRIVATE method with three parameters?

A

CreateMoveOption

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

name a Boolean variable

A

GameOver
Legit anything boolean

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

why is the random module used?

A

randomly selects the move offer option

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

what effect does the super routine in the class kotla have?

A

can use the method class in the parent class, even if polymorphism has taken place

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

is n^2 time complexity efficient, and how well does it scale up? (3)

A

efficient for small inputs
but as inputs grow, time increases
so it doesn’t scale up well

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

issue with using hard-coded string literals?

A

scope for typos so errors developed

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

what is overloading?

A

provide multiple implementations of a method with the same name
by selecting which version to run
by varying the parameters used

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

normal vs priority queues (note its a shit mark scheme)

A

Priority queue:
new data can join the queue in diff positions based on priority
they join at the back of their sub-queue
or join in front of their lower priority sub queue

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

why is it important to have multiple access modifiers

A

allows corrects encapsulation
leading to interaction via interfaces
also avoids exposure of dangerous attributes and methods

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

what is metadata and how can it be applied to dastan

A

data about the file/game itself
board size

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