wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Introduction to Algorithms and Programming Concepts

Total questions: 50

Worksheet time: 25mins

Name
Class
Date
1.

Which of the following best describes an algorithm?

a)

A sequence of steps used to complete a task

b)

A variable that stores numerical information

c)

A block of code that repeats infinitely

d)

A diagram used only for debugging

2.

A student writes pseudocode before coding. What is the purpose of pseudocode?

a)

To verify syntax before running a program

b)

To express program ideas in a language-agnostic way

c)

To store variables and data values

d)

To automatically convert code into flowcharts

3.

Which situation demonstrates sequencing?

a)

A loop that repeats 10 times

b)

A program choosing between two branches

c)

A series of instructions executed in order

d)

An event triggered by a mouse click

4.

Consider the code segment: x = 5 x = x + 3 What is the value of x?

a)

3

b)

5

c)

8

d)

15

5.

A conditional is used in a program to:

a)

Organize data into a list

b)

Provide user input

c)

Select different actions based on a Boolean expression

d)

Repeat a block of code until stopped

6.

What is the value of count after this code runs? count = 0 REPEAT 3 TIMES: count = count + 2

a)

2

b)

3

c)

6

d)

8

7.

A student wants a procedure to reduce repeated code. This is an example of:

a)

Sequencing

b)

Abstraction

c)

Data compression

d)

Iteration

8.

What does the following procedure do? PROCEDURE triple(n) RETURN n * 3

a)

Divides input by 3

b)

Multiplies input by 3

c)

Adds 3 to input

d)

Prints the input

9.

What is the effect of a loop that never changes its Boolean condition?

a)

Infinite loop

b)

Syntax error

c)

Stops after 10 iterations

d)

Changes variable values automatically

10.

Which of the following is considered an event?

a)

Loop variable updating

b)

User clicking a turtle graphic

c)

Variable storing a list

d)

Program reaching the last line

11.

What type of data is stored in: name = "Jordan"?

a)

Boolean

b)

Number

c)

String

d)

List

12.

Which best describes a list?

a)

A single piece of data

b)

A collection of ordered values

c)

A Boolean expression

d)

A mathematical function

13.

What is colors[1] in the list colors = ["red", "blue", "green"]?

a)

red

b)

blue

c)

green

d)

error

14.

Which Python instruction increases score by 1?

a)

score = + 1

b)

score = score + score

c)

score += 1

d)

score = score - 1

15.

A Boolean variable stores:

a)

Only positive numbers

b)

True or False values

c)

Any type of list

d)

Only strings

16.

A program records distances from a sensor. Best structure?

a)

String

b)

Boolean

c)

List

d)

Procedure

17.

What is the output of DISPLAY(animals[2]) if animals = ["cat", "dog", "bird"]?

a)

cat

b)

dog

c)

bird

d)

2

18.

What is an advantage of using a list?

a)

Prevents errors

b)

Automatically sorts

c)

Groups related data

d)

Runs faster than variables

19.

What is the output of RETURN(x AND y) if x = TRUE and y = FALSE?

a)

TRUE

b)

FALSE

20.

Data abstraction is:

a)

Lowering resolution

b)

Removing data

c)

Hiding implementation details

d)

Compressing data

21.

A function helps programmers by:

a)

Slowing the program

b)

Reducing repeated code

c)

Preventing loops

d)

Increasing memory usage

22.

Correct function definition in pseudocode?

a)

FUNCTION move()

b)

start move:

c)

PROCEDURE(move)

d)

CALL move()

23.

Parameters allow functions to:

a)

Execute without user input

b)

Store lists

c)

Accept input values

d)

Avoid using variables

24.

PROCEDURE addOne(x) RETURN x + 1 addOne(4) returns:

a)

1

b)

3

c)

4

d)

5

25.

Scenario demonstrating abstraction:

a)

Manually writing every detail

b)

Using a function without knowing its internals

c)

Creating more complex functions

d)

Using descriptive names

26.

Best description of a computing innovation:

a)

A theoretical idea

b)

A practical application

c)

A mathematical formula

d)

A programming error

27.

Digital data is represented using:

a)

Text

b)

Bits

c)

Images only

d)

Colors

28.

Harmful impact of computing includes:

a)

Encryption

b)

Storing private data insecurely

c)

Using open-source software

d)

Compressing a file

29.

An autonomous robot in a factory is an example of:

a)

Event-driven programming

b)

Innovation with benefits and harms

c)

Data compression

d)

Boolean logic

30.

A beneficial impact of automation is:

a)

Increased cyber attacks

b)

Job displacement

c)

Increased productivity

d)

Loss of data

31.

If x = 2, y = 3, and z = x * y + 1, what is the value of z?

a)

3

b)

5

c)

7

d)

9

32.

An infinite loop occurs when:

a)

Loop has a counter

b)

Condition never changes

c)

Loop runs 5 times

d)

Loop inside a function

33.

Using helper function to simplify code is:

a)

Decomposition

b)

Compression

c)

Iteration

d)

Event handling

34.

[72, 75, 80, 79, 70] is:

a)

Boolean

b)

List

c)

String

d)

Function

35.

num = 4 IF num > 2 THEN DISPLAY("High") ELSE DISPLAY("Low") What will be displayed?

a)

2

b)

High

c)

Low

d)

Error

36.

Events are:

a)

Loop counters

b)

User/system triggers

c)

Impossible without lists

d)

Hardware only

37.

Function returning random color is an example of:

a)

Procedural abstraction

b)

Data conversion

c)

Boolean logic

d)

Iteration

38.

Access last element of nums:

a)

nums[0]

b)

nums[-1]

c)

nums[last]

d)

nums[99]

39.

Hiding complexity inside function is:

a)

Compression

b)

Abstraction

c)

Iteration

d)

Simulation

40.

Repeat until condition false requires:

a)

Sequencing

b)

Conditionals

c)

Loop

d)

Boolean expression

41.

What are algorithms?

a)

Step-by-step instructions

b)

A type of data structure

c)

A programming language

d)

A mathematical formula

42.

What does pseudocode express?

a)

Syntax rules

b)

Logic without syntax

c)

Programming errors

d)

Data types

43.

What does sequencing mean in programming?

a)

Grouping data

b)

Executing steps in order

c)

Writing pseudocode

d)

Creating infinite loops

44.

What does the conditional statement do?

a)

Executes steps in order

b)

Chooses between paths

c)

Reduces repeated code

d)

Triggers events

45.

What happens when an unchanged condition occurs in a loop?

a)

The loop stops

b)

The loop executes once

c)

The loop causes an infinite loop

d)

The loop skips steps

46.

What is the purpose of abstraction in programming?

a)

Hides complexity

b)

Executes steps in order

c)

Triggers events

d)

Creates infinite loops

47.

What does a Boolean store?

a)

Numbers

b)

Strings

c)

True/False values

d)

Lists

48.

What does using a function demonstrate in programming?

a)

Abstraction

b)

Sequencing

c)

Conditional logic

d)

Infinite loops

49.

What does decomposition help with in problem-solving?

a)

Combining problems

b)

Breaking problems down

c)

Ignoring problems

d)

Solving problems directly

50.

What does a loop do until false?

a)

Stops immediately

b)

Repeats

c)

Skips iterations

d)

Produces errors