wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Unit 5 Summative C.S.

Total questions: 25

Worksheet time: 20mins

Name
Class
Date
1.
Which of the following are actions to take while debugging?
a)
Change names of variables
b)
Display values of variables are various points
c)
Delete code and re-type it
2.
Ignore E....
a)
b)
B
c)
C
d)
D
3.
What are a and b with the following code:
var a = 2
var b = 3
a = a + a
b = b +a
a)
a = 2, b = 3
b)
a = 4, b = 5
c)
a = 4, b = 7
d)
a = 2, b = 7
4.
What should the missing code be so that everytime addItemButton is clicked it adds one to the variable?
a)
cart total =1
b)
cartTotal + 1
c)
var cartTotal = cartTotal + 1
d)
cartTotal = cartTotal + 1
5.
Who developed Facebook?
a)
Steve Jobs
b)
Bill Gates
c)
Mark Zucherberg
d)
Michael Dell
6.
What will be displayed with the code:
x = 5
if (x > 8) {
display("Dog") }
else {
display("Cat") }
display("Robot")
a)
Cat
b)
Dog
c)
Dog Robot
d)
Cat Robot
7.
fake = p
p = q
q = fake
What does this code do?
a)
Set p and q equal to each other
b)
Doesn't do anything
c)
Causes an error
d)
Switches values for p and q
8.
var nome = "Gary"
var name = "Paul"
var sentence = ("Hello  "+name+" and "+nome+)
a)
Hello Paul and Gary
b)
Paul and Gary
c)
"Hello " +name+ " and "+nome
d)
Hello Gary and Paul
9.
What step is missing?
a)
Multiply the number by 2.
b)
Divide the number by 2.
c)
Multiply the number by 3.
d)
Divide the number by 3.
10.
WHO AM I
a)
Lionel Messi
b)
Cristiano Ronlado
c)
Dos Santos
d)
Neymar
11.
What will be displayed with this code?
a)
2,2,34,34,WALL,WALL
b)
2,34,34,WALL,2,34,34,WALL
c)
eRROR
d)
2,34,WALL,2,34,WALL
12.
What needs to go in to check the age is more than 5
IF ______ Then 
Console.Writeline ("You are older than 5")
a)
Age > 5
b)
Age < 5
c)
Age is more than 5
d)
Age = 5 
13.
A statement that is either true or false depending on the situation
a)
If Statement
b)
Nested Statements
c)
Conditional 
d)
Automate
14.
Is "2" the same as 2?
a)
Yes
b)
No
15.
Which rapper is Canadian?
a)
Naz
b)
Jay Z
c)
Dr. Dre
d)
Drake
16.
Katherine is creating a computer program that will allow the cursor to jump to a different location when the mouse is clicked on a certain image. Which programming component should Katherine use to tell the program what to do when the mouse is clicked on the image?
a)
a parameter
b)
A class
c)
An event
d)
An event handler
17.
What will be displayed when the following is run:
display (op2 (2))
a)
22
b)
2
c)
4
d)
2 ,2
18.
Which operator is an example of a Boolean operator?
a)
ll
b)
%
c)
!=
d)
++
19.
Fill in the blanks with a correct answer for the pseudo code below when the passing mark is  50 or higher.
BEGIN
request mark
___________________
print "fail"
else
print "pass"
END
a)
if mark  > 50
b)
if mark ≥ 50
c)
if mark < 50
d)
if mark ≤ 50
20.
Who is this?
a)
Moose & Squirrel
b)
Rocky & Bullwinkle
c)
Boris & Natasha
d)
Peabody & Sherman
21.
What will zeroCount equal at the end?
*
var testArray = [0, 1, 0, 0, 1, 0, 1, 0];
var zeroCount=0;
for (var i = 0; i < testArray.length; i++) {
if (testArray[i]==0) {
zeroCount+=2;}}
a)
5
b)
3
c)
10
d)
8
22.
What does list[4] equal after the code is run?
var list[1, 2, 6, 10];
appendItem (list, "3");
insertItem(list, 3, "shoe");
console.log(list);
a)
6
b)
10
c)
3
d)
shoe
23.
What football team is this
a)
lions
b)
panthers
c)
jaguars
d)
dolphins 
24.
Who is this?
a)
Adam Sandler
b)
Tom Cruise
c)
Robin Williams
d)
Brad Pitt 
25.
What will a,b, and c equal after this code:
a = 5
b= a
c = 3
a = b +c
c = a - c
a)
5, 5, 3
b)
8, 5, 5
c)
5, 8, 3
d)
8, 8, 5