WorksheetsEnd of Unit 2 Assessment
Total questions: 25
Worksheet time: 13mins
Name
Class
Date
1.
(4J) Why do we use while loops in Karel programming?
a)
To break out of some block of code
b)
To do something if a condition is true
c)
To repeat some code while a condition is true
d)
To repeat something for a fixed number of times
2.
(6E) Which of the following best explains the difference between input and output devices?
a)
Input devices store data, output devices process data.
b)
Input devices send data to the computer, output devices present data from the computer to the user.
c)
Input devices print documents, output devices scan documents.
d)
Input devices display images, output devices receive user commands.
3.
(6D) What is the primary purpose of an operating system?
a)
To perform calculations for math problems.
b)
To run and manage application software and hardware.
c)
To create graphics and images.
d)
To send emails and manage contacts.
4.
(6D) Which of the following best describes the relationship between system software and application software?
a)
Application software manages hardware resources, while system software helps perform specific tasks.
b)
System software manages hardware resources, while application software helps perform specific tasks.
c)
Both system and application software are used to perform specific tasks.
d)
System software is used to send emails, while application software runs the operating system.
5.
(6A) What is the main function of the Central Processing Unit (CPU) in a computer?
a)
To store data permanently.
b)
To process instructions and manage tasks.
c)
To display images on the screen.
d)
To provide power to the computer.
6.
(4H) Which of the following commands is a valid Karel command?
a)
move
b)
move;
c)
move();
d)
move()
7.
(3B) What makes the following command, turnleft(); , an invalid Karel command?
a)
It should end in a colon rather than a semicolon
b)
The "l" should be a capital L
c)
It should start with a capital T
d)
This command is correct
8.
(4C) Which of the following is the correct way to define a turnRight function in Karel?
a)
Option 1
b)
Option 2
c)
Option 3
d)
Option 4
9.
(4C) Why do we use functions in Karel programs?
a)
To break down our program into smaller parts
b)
Avoid repeating code
c)
Make our programs more readable
d)
All of the above
10.
(4C) In this code, how many times is the dance function called and how many times is it defined?
a)
Called 1 time, defined 1 time
b)
Called 1 time, defined 3 times
c)
Called 3 times, defined 1 time
d)
Called 3 times, defined 3 times
11.
(3B) What's wrong with this code?
a)
The go function is called twice
b)
The go function has a syntax error
c)
The go function has been defined twice
d)
go is not a command that Karel understands
12.
(4L) How many total times will Karel move in this program?
a)
1
b)
5
c)
6
d)
7
13.
(3B)(4J)
What is wrong with this for loop?
A. The for loop uses commas (,) instead of semicolons(;)
B. It should say i++ instead of i + 1
a)
A
b)
B
c)
A and B
d)
The for loop is correct
14.
(4J) What condition should be used in this while loop to get Karel to pick up all the tennis balls on the current location?
a)
ballsPresent()
b)
noBallsPresent()
c)
frontIsClear()
d)
takeBall()
15.
(4C) What is top down design?
a)
Top down design is a way of designing your program by starting with the biggest problem and breaking it down into smaller and smaller pieces that are easier to solve.
b)
Top down design is a way that you can create designs on a computer to put on a web page
c)
Top down design is a way of designing your programs starting with the individual commands first
d)
Top down design is a way to use loops and if statements to decompose the problem
16.
(4L) How can we improve the following program?
a)
Break down this program into more functions
b)
Use a for loop to repeat the move command
c)
Use a while loop to repeat the move command
d)
Fix the indentation of this program
17.
(4J) What is the purpose of using a for loop in code?
a)
To do something if a condition is true
b)
To do something while a condition is true
c)
To repeat something a fixed number of times
d)
To make programs run faster
18.
(4C) What is an algorithm?
a)
A computer program that runs on the internet
b)
A step-by-step set of instructions to solve a program
c)
A type of programming language
d)
A robot that follows instructions
19.
(4C) How many times should Karel turn left in order to turn right?
a)
1
b)
2
c)
3
d)
4
20.
(4I) An if statement will run its code even if the condition is false.
a)
True
b)
False
21.
(4I) What does the else part of an if/else statement do?
a)
Runs only when the condition is true.
b)
Runs only when the condition is false.
c)
Stops the program from running.
d)
Makes Karel move forward automatically.
22.
(4C) Which keyword is used to define a function in Karel?
a)
if
b)
function
c)
for
d)
repeat
23.
(4L) Look at the code below. What will happen when start() runs?
a)
Karel moves once and puts a ball
b)
Karel moves twice and puts a ball
c)
Karel only puts a ball
d)
Karel crashes
24.
(4C) Which statement correctly explains the difference between defining and calling a function in Karel?
a)
Defining a function tells Karel what the function does, while calling a function tells Karel to run (do) it.
b)
Defining a function and calling a function are the same thing.
c)
Calling a function means writing all the steps of the function again.
d)
Defining a function makes Karel run the function automatically every time.
25.
(3B) Why is debugging and syntax important in Karel programming?
a)
Karel can guess what you mean even if you forget semicolons or capitalization.
b)
Debugging and syntax don’t matter unless you write long programs.
c)
Correct syntax makes sure Karel understands the commands, and debugging helps fix mistakes when the program doesn’t work.
d)
Debugging is only needed if the computer is broken.
100 %
