wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Programming Basics Worksheet

Total questions: 26

Worksheet time: 13mins

Name
Class
Date
1.

What does the term pseudocode mean in programming?

a)

Code written in a specific programming language that the computer can run directly

b)

A set of mathematical formulas only

c)

A way of writing instructions in plain, simple language that looks like code but is not real code

d)

A type of loop used in algorithms

2.

Which construct would you use to check if a student passed (score ≥ 50)?

a)

Sequence

b)

Selection

c)

Iteration

d)

Variable declaration

3.

Variables should be named clearly to show their purpose.

a)

True

b)

False

4.

In sequence, steps might run in any order the computer decides.

a)

True

b)

False

5.

Selection lets a program choose between two or more paths.

a)

True

b)

False

6.

What does this loop print?

a)

Hi (once)

b)

HiHi

c)

HiHiHi

d)

Nothing

7.

In if age >= 18 then print("Adult") if age = 18, output is:

a)

Minor

b)

Adult

c)

18

d)

Error

8.

What will this print? x = 2 y = x * 3 print(y)

a)

2

b)

3

c)

5

d)

6

9.

Which statement is Loop?

a)

if score >= 90 then grade = "A"

b)

for i in range (1 , 5): print(i)

c)

x = 10

d)

grade = "B"

10.

Which line is selection?

a)

repeat 10 times

b)

if temp > 30 then print("Hot")

c)

x = x + 1

d)

print("Done")

11.

Which statement is selection?

a)

repeat 10 times

b)

if temp > 30 then print("Hot")

c)

x = x + 1

d)

print("Done")

12.

Which statement shows sequence?

a)

Steps run in order from top to bottom

b)

Repeating steps while a condition is true

c)

Choosing between alternatives

d)

Jumping to random steps

13.

What is the purpose of assignment in x = 5?

a)

Checks if x equals 5

b)

Sends 5 to the screen

c)

Stores the value of the variable 5 in x

d)

Adds x and 5

14.

A variable is best described as:

a)

A fixed value that never changes

b)

A named storage location that can hold a value

c)

A mathematical symbol only

d)

A type of loop

15.

Which of the following is the best data type to store a student’s name?

a)

Integer

b)

String

c)

Boolean

d)

Float

16.

Which statement about pseudocode is correct?

a)

It must be written in a programming language

b)

It is only used by computers

c)

It is a simple way for humans to plan code using plain language

d)

It cannot be changed once written.

17.

17. Decomposition is breaking down problems into _________.

a)

subproblems

b)

algorithms

c)

variables

d)

loops

18.

Computer programming is writing codes to solve computing problems

a)

صواب

b)

خطأ

19.

Name and Age of the user are not variables

a)

True

b)

False

20.

Which construct is used when you want the program to make a decision?

a)

Sequence

b)

Selection

c)

Repetition

d)

Loop

21.

Print ("Welcome") is an example of :

a)

Output

b)

Input

c)

Input and Output

22.

22. Int_Age= input("Enter your Age") is an example of :

a)

Input

b)

Output

c)

Input and Output

23.

23. Score) is an example of a Variable)

a)

Yes

b)

No

24.

A compound conditional uses more than one condition connected with logical operators.

a)

Yes

b)

No

25.

Which of the following is an example of a compound conditional?

a)

if x > 10:

b)

if x > 10 and y < 5:

c)

print(x)

26.

What is the main difference between selection and Loop?

a)

Selection repeats steps; iteration chooses between options

b)

Selection chooses between options; Loop repeats steps