stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
Duplicate of Programming quiz - Unit 3 Code.org Flashcards | StudBud
Explore
/
Duplicate of Programming quiz - Unit 3 Code.org
Duplicate of Programming quiz - Unit 3 Code.org
14 terms
·
StudBud Administration
A quiz on some of the programming concepts looked at in code.org's CSP unit 3.
Flashcards
14 cards
F
Practice quiz
P
Host live
L
Questions
14
Answers
1
What will happen when the button is pressed?
The program won't run due to the conflict in event handlers
Only the last event handler will run
Only the first event handler will run
Both event handlers will run in sequence
2
The code in the image is used to pass/fail students. What value of testScore is problematic?
-1
100
0
50
3
How many times does the loop run?
4
0
6
5
4
You can debug a program by
Running the code with test data to check its behaviour
Adding console.log statements to see the values of variables
Adding breakpoints in the development environment
All of the above
5
What is the output of the loop?
1, 2, 6, 24, 120
0, 1, 2, 3, 4
5, 20, 60, 120, 120
5, 20, 60, 120
6
The code that makes this work is:
z = x; x = y; y = x;
z = x; y = z; x = y;
z = x; x = y; y = z;
x = y; y = x;
7
The term debugging comes from
Who knows
Admiral Grace Hopper working in the 1940s
Thomas Edison in 1878 & early electronic engineering
The RAF testing aeroplane engines in WWII
8
Will the body of the if block be run?
No
Yes
Maybe
Depends
9
Loops are used to repeat a code chunk many times. Conditional statements are used to:
Test if the code is working properly
Run different code depending on the program state
Make code run more smoothly
Run only when the user triggers the correct event
10
An event handler takes three arguments: the UI element id, the event type and a function called
a pure function
the callback
the handler function
the event function
11
When the main loop in a GUI receives an event:
An event manager is fired
The event is displayed to the user
An event handler is fired
The event is passed to the javascript interpreter
12
GUI stands for
Graphics user interaction
Great user interface
Graphics usual interface
Graphical user interface
13
What is the binary number 1101 in decimal
1101
-5
42
13
14
Event-driven programming
B and C
B) Reacts to events generated by the user
A) Produces software for concerts and festivals
C) Reacts to events generated by the program and system