wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Grasshopper App Quiz

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.
How do I declare a new variable?
a)
var newVariable = 5;
b)
Variable int = new Variable();
c)
var 5 = myVariable;
d)
int var = 5;
2.
A store has 20 apples in inventory.How can you store this information in a JavaScript variable?
a)
var numApples == 20;
b)
20 = numApples;
c)
var numApples = 20;
d)
var num apples = 20;
3.
After running the following code, what will be the value of x?
y = 3;
x = 5 * y;
a)
3
b)
5
c)
15
d)
0
4.

What will this code print out?


var y = 5;

var x = y;

print(x);

a)

5

b)

y

c)

x

d)

5x

5.

What will this code print out?


var word = 'alphabet';

var alphabet = 'word';

print(alphabet);

a)

print(alphabet)

b)

'word'

c)

'alphabet'

d)

None of the above

6.

Which variable is storing an array?


var myShoes = 'sneakers, highHeels, pumps';

var yourShoes = [

'sneakers'

'highHeels'

'pumps'

];

var shoeColor = drawBox(blue);

a)

shoeColor

b)

myShoes

c)

yourShoes

7.

What code would you write to check if the grasshopper variable is holding the word 'happy'?


var grasshopper = 'happy';

a)

grasshopper = 'happy'

b)

grasshopper === 'happy'

c)

'happy'

8.

What will be the correct output for this flag?

a)

drawBoxes('bbb ggg rrr')

b)

drawBoxes('ggg yyy bbb')

c)

drawBoxes('aaa bbb ccc')

d)

None of the above

9.

How many blue boxes will be created with this code?

drawBoxes(bobb r r g)

a)

1

b)

4

c)

3

d)

5

10.

What will be the output of this code?

a)

water

water

b)

juice

water


c)

juice

juice

d)

water

juice

11.

I am a special variable, where i can store list of strings. Who am I?

a)

string

b)

character

c)

word

d)

array

12.

I am a zero or set of characters written inside single quotation mark. e.g. ' ' or 'sunday' . Who am I ?

a)

variable

b)

string

c)

answer

d)

output

13.

I am a javascript function used to display output. Who am I?

a)

var

b)

array

c)

print()

d)

output

14.

I am a value written in side parentheses along with the javascript function. Who am I?

a)

value

b)

result

c)

data

d)

argument

15.

I am a JavaScript function used to pickup one value from the array and display. Who am I?

a)

newLine()

b)

pickRandom()

c)

drawBox()

d)

turnLeft()