Scratch Test
By Mickey Arnold
starstarstarstarstarstarstarstarstarstar
Last updated 10 months ago
20 Questions
1 point
1
Question 1
1.
What is output by the code to the right?
set a to 75repeat 5 change a by -5say a
What is output by the code to the right?
set a to 75
repeat 5
change a by -5
say a
1 point
1
Question 2
2.
What is output by the code to the right?
set a to 63repeat 4 change a by -7say a
What is output by the code to the right?
set a to 63
repeat 4
change a by -7
say a
1 point
1
Question 3
3.
What is output by the code to the right?
set a to 100repeat 3 change a by -5say a
What is output by the code to the right?
set a to 100
repeat 3
change a by -5
say a
1 point
1
Question 4
4.
What is output by the code to the right?
set a to 60repeat 2 change a by 10say a
What is output by the code to the right?
set a to 60
repeat 2
change a by 10
say a
1 point
1
Question 5
5.
What is output by the code to the right?
set a to 50repeat 6 change a by 3say a
What is output by the code to the right?
set a to 50
repeat 6
change a by 3
say a
1 point
1
Question 6
6.
What is output by the code to the right?
set a to 0repeat 7 change a by 2say a
What is output by the code to the right?
set a to 0
repeat 7
change a by 2
say a
1 point
1
Question 7
7.
What is output by the code to the right?
set a to -14repeat 3 change a by 12say a
What is output by the code to the right?
set a to -14
repeat 3
change a by 12
say a
1 point
1
Question 8
8.
What is output by the code to the right?
set c to 1repeat until c > 49 change c by 8say c
What is output by the code to the right?
set c to 1
repeat until c > 49
change c by 8
say c
1 point
1
Question 9
9.
What is output by the code to the right?
set c to 5repeat until c > 60
change c by 10say c
What is output by the code to the right?
set c to 5
repeat until c > 60
change c by 10
say c
1 point
1
Question 10
10.
What is output by the code to the right?
set e to 90repeat until e < 20 if e > 50
change e by -15 else change e by -10say e
What is output by the code to the right?
set e to 90
repeat until e < 20
if e > 50
change e by -15
else
change e by -10
say e
1 point
1
Question 11
11.
What is output by the code to the right?
set e to 150set count to 0repeat until e < 75 if e > 100
change e by -20 else change e by -5 change count by 1say count
What is output by the code to the right?
set e to 150
set count to 0
repeat until e < 75
if e > 100
change e by -20
else
change e by -5
change count by 1
say count
1 point
1
Question 12
12.
What is output by the code to the right?
set f to 1
set g to 0
repeat until f > 20 change g by f change f by 4say g
What is output by the code to the right?
set f to 1
set g to 0
repeat until f > 20
change g by f
change f by 4
say g
1 point
1
Question 13
13.
What is output by the code to the right?
E. listset list as emptyset a to 2repeat 6 add a to listsay list
What is output by the code to the right?
E. list
set list as empty
set a to 2
repeat 6
add a to list
say list
1 point
1
Question 14
14.
What is output by the code to the right?
set list as emptyset b to 2repeat 4 change b by 3 add b to listsay list
What is output by the code to the right?
set list as empty
set b to 2
repeat 4
change b by 3
add b to list
say list
1 point
1
Question 15
15.
What is output by the code to the right?
set list as emptyset b to 5repeat 5 change b by 5 add b to listsay list
What is output by the code to the right?
set list as empty
set b to 5
repeat 5
change b by 5
add b to list
say list
1 point
1
Question 16
16.
Which of the following code statements would correctly fill <*1>?
//the following code would create a list//of random numbers//the user would be asked for a value//the code would search for value in the list//and remove each occurrence from the list
set list as emptyset rand to 0repeat 10 set rand to pick random 1 to 10 add rand to list
set count to 0ask "Enter a number" and waitset find to answerset spot to 1repeat 10 if item spot of list = find <*1> else <*2>
Which of the following code statements would correctly fill <*1>?
//the following code would create a list
//of random numbers
//the user would be asked for a value
//the code would search for value in the list
//and remove each occurrence from the list
set list as empty
set rand to 0
repeat 10
set rand to pick random 1 to 10
add rand to list
set count to 0
ask "Enter a number" and wait
set find to answer
set spot to 1
repeat 10
if item spot of list = find
<*1>
else
<*2>
1 point
1
Question 17
17.
Question 33 xxWhich of the following code statements would correctly fill <*2>?
//the following code would create a list//of random numbers//the user would be asked for a value//the code would search for value in the list//and remove each occurrence from the list
set list as emptyset rand to 0repeat 10 set rand to pick random 1 to 10 add rand to list
set count to 0ask "Enter a number" and waitset find to answerset spot to 1repeat 10 if item spot of list = find <*1> else <*2>
Question 33 xx
Which of the following code statements would correctly fill <*2>?
//the following code would create a list
//of random numbers
//the user would be asked for a value
//the code would search for value in the list
//and remove each occurrence from the list
set list as empty
set rand to 0
repeat 10
set rand to pick random 1 to 10
add rand to list
set count to 0
ask "Enter a number" and wait
set find to answer
set spot to 1
repeat 10
if item spot of list = find
<*1>
else
<*2>
1 point
1
Question 18
18.
What is returned by the call isBiggerThan25( -11 ) ?
isBiggerThan25( number ) if number > 25 report true report false
What is returned by the call isBiggerThan25( -11 ) ?
isBiggerThan25( number )
if number > 25
report true
report false
1 point
1
Question 19
19.
What is returned by the call isMystery( 77 ) ?
isMystery( number ) if number < 0 report true report false
What is returned by the call isMystery( 77 ) ?
isMystery( number )
if number < 0
report true
report false
1 point
1
Question 20
20.
What is returned by the call
countEm( 1,2,3,4,14,5,6,7,21 ) ?
isHuh( number ) if not number mod 2 = 0 report false report true
countEm( list ) set spot to 0 set count to 0 repeat length of list if isHuh(item spot of list) change count by 1
change spot by 1 report count
What is returned by the call
countEm( 1,2,3,4,14,5,6,7,21 ) ?
isHuh( number )
if not number mod 2 = 0
report false
report true
countEm( list )
set spot to 0
set count to 0
repeat length of list
if isHuh(item spot of list)
change count by 1
change spot by 1
report count