WorksheetsComputer Literacy Midterm 2025
Total questions: 54
Worksheet time: 27mins
Name
Class
Date
1.
Which of the following best describes the role of the "home row" in typing?
a)
A) It is where your fingers start and return to while typing.
b)
B) It is used for typing numbers only.
c)
C) It helps you memorize special function keys.
d)
D) It is used exclusively for the spacebar.
2.
Which fingers are typically used to type the "F" and "J" keys?
a)
A) Left index finger for F, right index finger for J
b)
B) Left middle finger for F, right middle finger for J
c)
C) Left pinky finger for F, right pinky for J
d)
D) Left thumb for F, right thumb for J
3.
What does defining a function do in JavaScript/Karel?
a)
Immediately runs the code inside the function when the definition is read
b)
Creates a reusable block of code that can be executed when called
c)
Automatically repeats the block a fixed number of times
d)
Converts code into a comment so it won't run
4.
How do you run (execute) a function named buildStair that has already been defined?
a)
call buildStair;
b)
run buildStair()
c)
buildStair();
d)
execute buildStair();
5.
Which for loop runs its body exactly 5 times?
a)
for(var i=0; i<5; i++){. . .}
b)
for(var i=1; i<5; i++){. . .}
c)
for(var i=0; i>5; i++){. . .}
d)
for(var i=0; i<=5; i++){. . .}
6.
Which of the following is the correct way to define a function named cleanRow()?
a)
function cleanRow { ... }
b)
function cleanRow() { ... }
c)
cleanRow() = function { ... }
d)
define cleanRow() { ... }
7.
Why is using functions helpful when coding Karel problems?
a)
They make code run faster on the computer hardware
b)
They let you hide syntax errors automatically
c)
They let you name and reuse sequences of actions, reducing repetition
d)
They prevent Karel from moving until you delete the function
8.
Consider this snippet:
for(var i=0; i<n; i++){
putBall();
}
If n=3, how many balls are placed?
a)
2
b)
3
c)
4
d)
Depends on Karel's starting position
9.
Which debugging strategy is NOT recommended when fixing a broken Karel program?
a)
Run small parts of the code step by step and test frequently
b)
Read error messages and check syntax near reported lines
c)
Change many parts of the program at once and then test
d)
Ask a partner to read your code and explain what each part should do
10.
Why should you use the "home row" when typing?
a)
A) It’s where the most frequently used keys are located
b)
B) It reduces the amount of stretching your fingers do
c)
C) It helps keep your hands from getting tired quickly
d)
D) All of the above
11.
What is HTML primarily used for?
a)
General programming
b)
To create the structure of a webpage
c)
To define how the page behaves
d)
To style the content of a word document
12.
Which HTML tag is used to define the largest heading on a webpage?
a)
<h1>
b)
<h2>
c)
<head>
d)
<heading>
13.
What does the <ul>
tag represent in HTML?
a)
An unordered list
b)
An ordered list
c)
A paragraph
d)
A table
14.
Which of the following is the correct way to add a comment in HTML?
a)
<!-- This is a comment -->
b)
# This is a comment
c)
// This is a comment
d)
/* This is a comment */
15.
What does the <body> tag represent in an HTML document?
a)
The metadata of the webpage
b)
The main content of the webpage
c)
The header of the webpage
d)
The title of the webpage
16.
What is a function in JavaScript?
a)
A. A type of loop
b)
B. A reusable block of code that performs a specific task
c)
C. A conditional statement
d)
D. A variable declaration
17.
Which of the following is the correct way to write an if statement in JavaScript?
a)
A. if [condition] {code}
b)
B. if (condition) {code}
c)
C. if condition then {code}
d)
D. if condition {code}
18.
What is the purpose of a while loop?
a)
A. To execute code exactly once
b)
B. To execute code a specific number of times
c)
C. To execute code as long as a condition is true
d)
D. To skip over a section of code
19.
What symbol is used to separate different parts of a for loop?
a)
A. Comma (,)
b)
B. Colon (:)
c)
C. Semicolon (;)
d)
D. Period (.)
20.
Which statement is used to make decisions in JavaScript?
a)
A. switch
b)
B. while
c)
C. for
d)
D. if
21.
What happens if none of the conditions in an if/else if/else statement are true?
a)
A. The code crashes
b)
B. The else block executes
c)
C. Nothing happens
d)
D. The program restarts
22.
How many times will a while loop run?
a)
A. Only once
b)
B. A fixed number of times
c)
C. As long as the condition remains true
d)
D. Exactly 10 times
23.
What is the difference between if/else and if/else if/else?
a)
A. There is no difference
b)
B. if/else if/else can check multiple conditions
c)
C. if/else is faster
d)
D. if/else if/else uses less memory
24.
What do we call a piece of code that does a specific task when we run it?
a)
A. A loop
b)
B. A function
c)
C. A variable
d)
D. A condition
25.
What is the purpose of the else statement?
a)
A. To check additional conditions
b)
B. To execute code when the if condition is true
c)
C. To execute code when the if condition is false
d)
D. To end the program
26.
How do you call a function in JavaScript?
a)
A. function.run();
b)
B. run function();
c)
C. functionName();
d)
D. call functionName;
27.
If you have an if statement, what do the curly braces {} do?
a)
A. They make the code look nice
b)
B. They group together the code that should run if the condition is true
c)
C. They end the program
d)
D. They are optional and don't do anything
28.
Which loop would you use if you know exactly how many times you want to repeat something?
a)
A. while loop
b)
B. for loop
c)
C. if statement
d)
D. else statement
29.
What type of loop should we use when we want something to repeat until something is finished?
a)
A. for loop
b)
B. while loop
c)
C. if statement
d)
D. else statement
30.
In JavaScript, what is the correct way to write a comment?
a)
A. #comment
b)
B. //comment
c)
C. /*comment
d)
D. --comment
31.
What is the main purpose of a function?
a)
A. To store numbers
b)
B. To print text
c)
C. To organize code we want to use multiple times
d)
D. To make the program run faster
32.
When would you use a while loop instead of a for loop?
a)
A. When you want the code to run exactly 3 times
b)
B. When you don't know exactly how many times the code needs to repeat
c)
C. When you want the code to run faster
d)
D. When you want to stop the program
33.
What does the else part of an if/else statement do?
a)
A. Runs code when the if part is false
b)
B. Runs code when the if part is true
c)
C. Stops the program
d)
D. Repeats the code
34.
What HTML tag is used to create a hyperlink?
a)
<a>
b)
<link>
c)
<href>
d)
<url>
35.
Which attribute is required in an image tag?
a)
alt
b)
title
c)
src
d)
width
36.
Which HTML tag creates an unordered list?
a)
<ol>
b)
<li>
c)
<dl>
d)
<ul>
37.
In CSS, how do you select an element with the id "header"?
a)
.header
b)
#header
c)
header
d)
*header
38.
Which CSS property changes the text color?
a)
text-color
b)
font-color
c)
color
d)
text-style
39.
What does CSS stand for?
a)
Computer Style Sheets
b)
Creative Style System
c)
Cascading Style Sheets
d)
Colorful Style Sheets
40.
Which HTML tag is used to define an internal style sheet?
a)
<css>
b)
<script>
c)
<style>
d)
<design>
41.
How do you add a background color in CSS?
a)
color: yellow;
b)
background-color: yellow;
c)
bgcolor: yellow;
d)
background: yellow;
42.
Which tag is used to create a line break?
a)
<break>
b)
<lb>
c)
<newline>
d)
<br>
43.
In HTML, which attribute specifies an alternate text for an image if the image cannot be displayed?
a)
title
b)
src
c)
alt
d)
description
44.
How do you make text bold in HTML?
a)
<bold>
b)
<strong>
c)
<b>
d)
<b> or <strong>
45.
What is the correct HTML for adding a background color?
a)
<body style="background-color:yellow;">
b)
<background>yellow</background>
c)
<body bgcolor="yellow">
d)
<body color="yellow">
46.
Which HTML element defines the title of a document that appears in the browser tab?
a)
<meta>
b)
<head>
c)
<header>
d)
<title>
47.
How do you create an ordered list in HTML?
a)
<dl>
b)
<ul>
c)
<list>
d)
<ol>
48.
Which CSS property is used to change the font of an element?
a)
font-style
b)
font-family
c)
text-font
d)
font-type
49.
How do you center align text in CSS?
a)
text-align: center;
b)
align: center;
c)
text-center: true;
d)
center-text: on;
50.
What happens when we put one loop inside another loop?
a)
A. The computer gets confused
b)
B. The first loop runs, then the second loop runs
c)
C. The inside loop runs for each time the outside loop runs
d)
D. Both loops run at the same time
51.
In a Google Doc, what happens when you highlight text and click the color button?
a)
The page changes color
b)
The text changes color
c)
The screen changes color
d)
Nothing happens
52.
If you want to start over with a blank document, what should you click?
a)
File > New
b)
Help
c)
Tools
d)
View
53.
Which programming concept is used to repeat a set of instructions?
a)
Loop structures
b)
Variables
c)
Functions
d)
Comments
54.
What is the purpose of HTML in web development?
a)
Style web pages
b)
Add interactivity
c)
Structure web content
d)
Process server requests
100 %
