Unit 5 CSP Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Event-driven programs

A

written to respond to specified events by executing a block of code or function

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

Will everything in an event driving program always execute?

A

No!

Some portions of the code will never execute

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

Can the order of an event driven program be known ahead of time?

A

No

Because it relies on an event to happen. Each time depending on the user something new can happen

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

Do even driven programs implement algorithms?

A

Yes

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

Element IDs

A
  • IDs should be meaningful and descriptive

- allow a programmer to reference interface elements within their code

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

What must any element that is triggered by onEvent have?

A

unique ID

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

Can two or more onEvent calls reference the same ID?

A

Yes

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

Does an element ID always need an unique event handler associated with it?

A

No

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

What are two actions a programmer could take when debugging code?

A
  • display the value of variables at various points during the program
  • ask a friend or collaborator to look over the code segment to see if they are able to find any errors
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Global variable

A

Defined outside of a function and can be used anywhere in code

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

Local variable

A

Defined inside of a function and can only be used in that function

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