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