Unit 5 CSP Flashcards Preview

Computer Science > Unit 5 CSP > Flashcards

Flashcards in Unit 5 CSP Deck (11):
1

Event-driven programs

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

2

Will everything in an event driving program always execute?

No!

Some portions of the code will never execute

3

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

No

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

4

Do even driven programs implement algorithms?

Yes

5

Element IDs

-IDs should be meaningful and descriptive

-allow a programmer to reference interface elements within their code

6

What must any element that is triggered by onEvent have?

unique ID

7

Can two or more onEvent calls reference the same ID?

Yes

8

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

No

9

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

-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

10

Global variable

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

11

Local variable

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