NEW
Font size
WorksheetsIntroduction to Algorithms and Programming Concepts
Total questions: 50
Worksheet time: 25mins
Which of the following best describes an algorithm?
A sequence of steps used to complete a task
A variable that stores numerical information
A block of code that repeats infinitely
A diagram used only for debugging
A student writes pseudocode before coding. What is the purpose of pseudocode?
To verify syntax before running a program
To express program ideas in a language-agnostic way
To store variables and data values
To automatically convert code into flowcharts
Which situation demonstrates sequencing?
A loop that repeats 10 times
A program choosing between two branches
A series of instructions executed in order
An event triggered by a mouse click
Consider the code segment: x = 5 x = x + 3 What is the value of x?
3
5
8
15
A conditional is used in a program to:
Organize data into a list
Provide user input
Select different actions based on a Boolean expression
Repeat a block of code until stopped
What is the value of count after this code runs? count = 0 REPEAT 3 TIMES: count = count + 2
2
3
6
8
A student wants a procedure to reduce repeated code. This is an example of:
Sequencing
Abstraction
Data compression
Iteration
What does the following procedure do? PROCEDURE triple(n) RETURN n * 3
Divides input by 3
Multiplies input by 3
Adds 3 to input
Prints the input
What is the effect of a loop that never changes its Boolean condition?
Infinite loop
Syntax error
Stops after 10 iterations
Changes variable values automatically
Which of the following is considered an event?
Loop variable updating
User clicking a turtle graphic
Variable storing a list
Program reaching the last line
What type of data is stored in: name = "Jordan"?
Boolean
Number
String
List
Which best describes a list?
A single piece of data
A collection of ordered values
A Boolean expression
A mathematical function
What is colors[1] in the list colors = ["red", "blue", "green"]?
red
blue
green
error
Which Python instruction increases score by 1?
score = + 1
score = score + score
score += 1
score = score - 1
A Boolean variable stores:
Only positive numbers
True or False values
Any type of list
Only strings
A program records distances from a sensor. Best structure?
String
Boolean
List
Procedure
What is the output of DISPLAY(animals[2]) if animals = ["cat", "dog", "bird"]?
cat
dog
bird
2
What is an advantage of using a list?
Prevents errors
Automatically sorts
Groups related data
Runs faster than variables
What is the output of RETURN(x AND y) if x = TRUE and y = FALSE?
TRUE
FALSE
Data abstraction is:
Lowering resolution
Removing data
Hiding implementation details
Compressing data
A function helps programmers by:
Slowing the program
Reducing repeated code
Preventing loops
Increasing memory usage
Correct function definition in pseudocode?
FUNCTION move()
start move:
PROCEDURE(move)
CALL move()
Parameters allow functions to:
Execute without user input
Store lists
Accept input values
Avoid using variables
PROCEDURE addOne(x) RETURN x + 1 addOne(4) returns:
1
3
4
5
Scenario demonstrating abstraction:
Manually writing every detail
Using a function without knowing its internals
Creating more complex functions
Using descriptive names
Best description of a computing innovation:
A theoretical idea
A practical application
A mathematical formula
A programming error
Digital data is represented using:
Text
Bits
Images only
Colors
Harmful impact of computing includes:
Encryption
Storing private data insecurely
Using open-source software
Compressing a file
An autonomous robot in a factory is an example of:
Event-driven programming
Innovation with benefits and harms
Data compression
Boolean logic
A beneficial impact of automation is:
Increased cyber attacks
Job displacement
Increased productivity
Loss of data
If x = 2, y = 3, and z = x * y + 1, what is the value of z?
3
5
7
9
An infinite loop occurs when:
Loop has a counter
Condition never changes
Loop runs 5 times
Loop inside a function
Using helper function to simplify code is:
Decomposition
Compression
Iteration
Event handling
[72, 75, 80, 79, 70] is:
Boolean
List
String
Function
num = 4 IF num > 2 THEN DISPLAY("High") ELSE DISPLAY("Low") What will be displayed?
2
High
Low
Error
Events are:
Loop counters
User/system triggers
Impossible without lists
Hardware only
Function returning random color is an example of:
Procedural abstraction
Data conversion
Boolean logic
Iteration
Access last element of nums:
nums[0]
nums[-1]
nums[last]
nums[99]
Hiding complexity inside function is:
Compression
Abstraction
Iteration
Simulation
Repeat until condition false requires:
Sequencing
Conditionals
Loop
Boolean expression
What are algorithms?
Step-by-step instructions
A type of data structure
A programming language
A mathematical formula
What does pseudocode express?
Syntax rules
Logic without syntax
Programming errors
Data types
What does sequencing mean in programming?
Grouping data
Executing steps in order
Writing pseudocode
Creating infinite loops
What does the conditional statement do?
Executes steps in order
Chooses between paths
Reduces repeated code
Triggers events
What happens when an unchanged condition occurs in a loop?
The loop stops
The loop executes once
The loop causes an infinite loop
The loop skips steps
What is the purpose of abstraction in programming?
Hides complexity
Executes steps in order
Triggers events
Creates infinite loops
What does a Boolean store?
Numbers
Strings
True/False values
Lists
What does using a function demonstrate in programming?
Abstraction
Sequencing
Conditional logic
Infinite loops
What does decomposition help with in problem-solving?
Combining problems
Breaking problems down
Ignoring problems
Solving problems directly
What does a loop do until false?
Stops immediately
Repeats
Skips iterations
Produces errors
