Font size
WorksheetsSoftware Tech. MidTerm
Total questions: 40
Worksheet time: 20mins
Which function will turn Karel around?
function turnAround()
turnLeft();
turnLeft();
turnLeft();
}
function turnAround(){
turnLeft();
turnLeft();
turnLeft();
}
function turnAround(){
turnLeft();
turnLeft();
turnleft();
}
How do we get a function to run in our program?
We write it when we want to use it in a program
We call it when we want to use it in a program
We can set a time for it to run
It runs automatically
Which is the correct code?
turnLeft();
putBall();
move():
putBall();
move();
turnLeft();
putBall()
move()
putBall:
move();
turnLeft();
putBall();
move():
putall:
move();
Karel is stood at position (dot) 0,0. What position is the dot 2 places after Karel and 1 up?
2,1
1,2
0,2
2,0
I want Karel to move, drop a ball and move once again. Which is the correct code?
function dropball(){
move();
putball();
move();
}
function dropball(){
putBall);
putBall();
move();
}
function dropball(){
move();
putBall();
move();
}
What is the least number of times Karel needs to move forward (East) to complete this program? she starts at 0,0
2
3
4
5
Why do we use functions in a program?
Easier to find bugs/problems in a program
The program reads functions at a faster pace
Functions take less time to write
Organises the program more efficiently
Which is the correct program?
move();
turnLeft();
putBall();
move();
move();
putBall();
move(0;
turnLeft()
move();
putBall();
move();
turnLeft();
2 of the functions have bugs in them...which is correct
function move(){
turnLeft();
turnLeft();
turnLeft();
}
function move(){
turnLeft();
turnLeft();
turnLeft();
function move(){
turnleft();
turnLeft();
turnLeft();
}
for(var i = 0; i < 8; i++){
move();
How many times will Karel move?
5
6
7
8
Why do we use a for loop in programming
Easier to read
It's more efficient
To repeat an action a number of times
It helps with sequencing
Which code is correct? Karel starts at 0,0.
for(var i = 0; i < 4; i++){
move();
}
putBall();
for(var i = 0; i < 2; i++){
move();
}
putBall();
for(var i = 0; i < 3; i++){
move();
}
putBall();
Which of the following is a basic rule for naming functions
Using single letters like X, Y, or Z is a good name
Names should start with a number
Multiple words in a name should be separated by spaces
The name should describe what the function does
For the function:
def turn_around():
turn_left()
turn_left()
We tell Karel to perform the function by the following command:
my turn_around():
turn_around():
turn_left():
run turn_around():
What is a code comment?
A way to teach Karel a new word
A way to give notes to the reader to explain what your code is doing
A message to your teacher in code
A place to write whatever you want in your code
What do you call it when you don't use spaces but instead capitalize each word in a Java command?
camel case
cow case
kookaburra case
cucumber case
Tape measure
What item of machinery is this?
Planer Thicknesser
Band Saw
Table Saw
Router
What is the power tool in the image?
Planer
Router
Sander
Power Drill
Which among the image is the CLAW HAMMER
Which among the tools is the PowerDrill?
Which among the tools are the Mallets?
identify tool / machine
belt sander
snow cone machine
bender
cnc table
identify tool / machine
band saw
fork
welpers
adjustable wrench
identify tool / machine
vice clamp
fuel pump
sanding rod
angle grinder
What is the length of the black line?
283 inches
2 inches
221 inches
3 inches
This is made of metal used for fastening.
nail
claw hammer
ripsaw
Identify this tool.
Portable Circular Saw
Cordless Drill
Hack Saw
Circular Saw Blade
Name this tool
Disc Sander
Spindle Grinder
Pedestal Grinder
Drill Press
Name this tool
Disc Sander
Spindle Grinder
Pedestal Grinder
Miter Saw
NAME THE TOOL
NEEDLE NOSE PLIERS
OPEN END WRENCH
ADJUSTABLE WRENCH
LOCKING PLIERS
phillips (cross) screwdriver
stanley (straight) screwdriver
standard (flathead) screwdriver
paint can opener
