wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Intro to CS - Midterm Review

Total questions: 59

Worksheet time: 42mins

Name
Class
Date
1.

The inputs and outputs that allow a user to interact with a piece of software.

a)

Useful Interchange

b)

User Input

c)

User Interface

d)

User Intention

2.

Data that are sent to a computer for processing by a program.

a)

Output

b)

Screen

c)

Input

d)

User Interface

3.

Any data that are sent from a program to a device.

a)

Input

b)

Output

c)

Outdate

d)

Program

4.

A set of commands, instructions, and other syntax use to create a software program.

a)

User Interface

b)

Encryption

c)

Coding

d)

Programming Language

5.

A command or instruction. Sometimes also referred to as a code statement.

a)

User Interface

b)

Program Statement

c)

Coding

d)

Programming Language

6.

A collection of program statements. Programs run (or “execute”) one command at a time.

a)

Program

b)

Program Statement

c)

Coding

d)

Programming Language

7.

Program statements run in order, from top to bottom.

a)

Sequential Programming

b)

Event Driven Programming

8.

Some program statements run when triggered by an event, like a mouse click or a key press.

a)

Sequential Programming

b)

Event Driven Programming

9.

What will the console log say when this program is run?

a)

"Starting my program!"

"You clicked the button!"

"Ending my program!"

b)

"Starting my program!"

"Ending my program!"

"You clicked the button!"

c)

"You clicked the button!"

"Starting my program!"

"Ending my program!"

d)

"You clicked the button!"

"Ending my program!"

"Starting my program!"

10.

After the program is run, what will the text color of smallButton be?

a)

red

b)

blue

c)

green

d)

yellow

11.

If the user clicks the button, what color will "topButton" be when the program finishes running?

a)

red

b)

green

c)

blue

d)

orange

12.

When this program is run, the user clicks "topButton" then "bottomButton" and then "topButton" again. What will be displayed in the console?

a)

aaa

bbb

ccc

aaa

b)

aaa

ccc

bbb

aaa

c)

ccc

aaa

bbb

aaa

d)

aaa

bbb

aaa

ccc

13.

What is a reason to include comments in a program?

a)

Comments tell the computer what the code is doing.

b)

Comments tell the programmer what the code is doing.

c)

Comments help the user work an app more effectively.

d)

Comments will show up in the console so when the program is run, the programmer know what happens.

14.

How many bits are in a byte?

a)

4

b)

255

c)

0

d)

8

15.

1111 1111

a)

128

b)

255

c)

256

d)

127

16.

What is 1101 1110 in decimal form?

(a)  

17.

Convert the decimal number 44 to binary.

(a)  

18.

Convert 0101 1100 to decimal form?

(a)  

19.

Convert the decimal number 83 to binary.

(a)  

20.

What is 1100 1011 in decimal form?

(a)  

21.

Convert the decimal number 140 to binary.

(a)  

22.

What is 0101 0101 in decimal form?

(a)  

23.

Convert the decimal number 14 to binary.

(a)  

24.

How are shapes plotted on the screen?

a)

with alphabet letters

b)

with X and Y coordinates

c)

using a touch screen

d)

with width and height values

25.

The x value represents...

a)

How far away from the left of the screen

b)

How far away from the right of the screen

c)

How far away from the top of the screen

d)

How far away from the bottom of the screen

26.

The y value represents...

a)

How far away from the right of the screen

b)

How far away from the left of the screen

c)

How far away from the bottom of the screen

d)

How far away from the top of the screen

27.

What is the origin of a square or rectangle?

a)

The bottom right corner

b)

The bottom left corner

c)

The top right corner

d)

The top left corner

28.

What is the origin of a circle or ellipse?

a)

The bottom left corner

b)

The center

c)

The bottom right corner

d)

The top

29.

In this line of code:

rect(250, 100);

which number is the y value?

a)

rect

b)

250

c)

100

30.

In this line of code: rect(250, 250, 100, 50); what do 100 and 50 represent?

a)

The x and y values

b)

The w and h values

31.

Given rect(x, y, w, h); what are w and h?

a)

width and heavy

b)

width and tallness

c)

width and length

d)

width and height

32.

The line of code: background("red"); will change what red?

a)

Any shapes on the screen

b)

The background

c)

The foreground

d)

Nothing

33.

What line of code will change the color of any shapes coded below it?

a)

color

b)

rect

c)

weight

d)

fill

34.

What does the randomNumber line of code do?

a)

picks the same number every time

b)

picks any number from zero to infinity

c)

picks any number from the minimum and maximum that you set

d)

it doesn't do anything

35.

Can you use the randomNumber line of code to replace a single value, such as a y value?

a)

Yes!

b)

No!

36.

This line of code does what?

var hello = 100

a)

creates a variable

b)

names or labels the variable "hello"

c)

sets the value of the variable hello to 100

d)

All three are correct

37.

Which command matches this block of code?

a)

Creates a new sprite and assigns it to the variable specified.

b)

Declares and assigns an initial value to a variable

c)

Draws an ellipse onto the display centered at x and y and inscribed in a rectangle with sides length w(idth) and h(eight).

38.

Which command matches this block of code?

a)

Declares and assigns an initial value to a variable.

b)

The number of times per second the screen is refreshed.

c)

Returns a random number in the closed range from min to max.

39.

Which command matches this block of code?

a)

Draws an ellipse keeping the height to width ratio the same.

b)

Shrink or grow a sprite keeping the height to width ratio the same.

c)

Draws a rectangle keeping the height to width ratio the same.

40.

Which command matches this block of code?

a)

Displays a group of sprites. If no parameter is specified, draws all sprites in the sketch.

b)

Shrink or grow a sprite keeping the height to width ratio the same.

c)

The lines of code contained inside its block are continuously executed until the program is stopped.

41.

Finding and fixing problems in an algorithm or program.

a)

Bug

b)

Variable

c)

Property

d)

Debugging

42.

A graphic character on the screen with properties that describe its location,

a)

Sprite

b)

Property

c)

Animation

d)

Variable

43.

A series of images that create the illusion of motion by being shown rapidly one after the other

a)

Frame

b)

Animation

c)

Bug

44.
What is at the end of a line of code?
a)
#
b)
;
c)
)
d)
>
45.

What is x value in the following code?

rect(250, 200, 75, 225);

a)

250

b)

200

c)

75

d)

225

46.

In which direction will the sprite move?

bee.y = bee.y + 2

a)

left

b)

right

c)

up

d)

down

47.

Which sprite property would you change to move the sprite from left to right?

a)

sprite.x

b)

sprite.y

c)

sprite.scale

d)

sprite.rotation

48.

Which sprite property would you change to make the sprite turn in a circle?

a)

sprite.x

b)

sprite.y

c)

sprite.scale

d)

sprite.rotation

49.

What will the console log say when this program is run?

a)

"Starting my program!"

"You clicked the button!"

"Ending my program!"

b)

"Starting my program!"

"Ending my program!"

"You clicked the button!"

c)

"You clicked the button!"

"Starting my program!"

"Ending my program!"

d)

"You clicked the button!"

"Ending my program!"

"Starting my program!"

50.

Which line of code is most likely to return an error?

a)

1

b)

2

c)

3

d)

4

51.

Which command matches this block of code?

a)

Draws an ellipse keeping the height to width ratio the same.

b)

Shrink or grow a sprite keeping the height to width ratio the same.

c)

Draws a rectangle keeping the height to width ratio the same.

52.

Which direction will the sprite move in the code pictured? (Click on picture to enlarge.)

a)

Left

b)

Right

c)

Up

d)

Down

53.

What keyboard key do you need press to move the sprite?

a)

x

b)

y

c)

up arrow

d)

space

54.

What is the name of the sprite variable in the code pictured? (Click on picture to enlarge.)

a)

fly

b)

ladybug

c)

bug

d)

space

55.

This plane looks like someone is smearing a stamp across a paper.


How would you fix this code so that it looks likes the plane is smoothly moving across the scene? (Click on image to enlarge.)

a)

(line 8) increase the speed of the plane in the draw loop.

b)

(line 7) add plane.rotation into the draw loop

c)

(line 4) add a drawSprites

d)

(line 3) move the background code into the draw loop so that it makes a new background each loop

56.

Match the code with the output

a)
b)
c)
57.

Match the code with the output

a)
b)
c)
58.
a)
b)
c)
59.

Which command matches this block of code?

a)

The number of times per second the screen is refreshed.

b)

The lines of code contained inside its block are continuously executed until the program is stopped.

c)

Creates a new sprite and assigns it to the variable specified.