wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

N5 Computing Science: Computational Constructs

Total questions: 95

Worksheet time: 49mins

Name
Class
Date
1.

Which of the following program constructs is NOT required for N5 Computing Science?

a)

Values can be stored in variables.

b)

Arithmetic operators can be used on numerical values.

c)

Repetition constructs can be used to repeat blocks of code.

d)

Using switch-case statements to handle multiple conditions.

2.

What should you be able to describe and use by the end of the topic on Computational Constructs?

a)

Expressions to assign values to variables.

b)

How to use social media platforms.

c)

The history of programming languages.

d)

Techniques for effective internet search.

3.

Which of the following is NOT listed as a predefined function in a programming environment that you should be familiar with?

a)

random

b)

round

c)

length

d)

abs

4.

What type of constructs should you be able to use for creating simple conditions?

a)

Selection constructs like IF statements

b)

Repetition constructs like FOR loops

c)

Assignment constructs like variable declaration

d)

Exception handling constructs like TRY-CATCH

5.

Which of these logical operators is NOT included in N5 Computing Science?

a)

AND

b)

OR

c)

XOR

d)

NOT

6.

What would the following line of code do?

SET answer TO 100 / 4

a)

Divide 100 by 4 and store the result in the answer variable.

b)

Multiply 100 by 4 and store the result in the answer variable.

c)

Store the characters "100 / 4" in the answer variable.

d)

Crash the program as the translator would not recognise the "/" symbol.

7.

How many times would the phrase "Hello World" appear on screen if the following code was run?

a)

1

b)

5

c)

6

d)

10

8.

When would the message "pass" be displayed when the following code is run?

a)

When the score variable's value is less than 10.

b)

When the score variable's value is greater than 10.

c)

When the score variable's value is equal to 10.

d)

It will always be displayed.

9.

Which of the following is NOT a building blocks of a programming language that you should be familiar with for N5 Computing Science ?

a)

Keywords

b)

Constructs

c)

Functions

d)

Variables (and arrays)

10.

What is the purpose of an assignment statement in programming?

a)

To perform a calculation

b)

To store an item of data in a variable

c)

To compare two values

d)

To execute a program

11.

How many different types of arithmetic operators are there?

a)

Two

b)

Three

c)

Four

d)

Five

12.

What is an expression in programming?

a)

A command to execute an action

b)

A set of instructions for a loop

c)

A combination of data items, operators, and fixed values that need to be computed

d)

A declaration of a variable

13.

Which of the following is an example of a programming construct?

a)

A variable declaration

b)

An arithmetic operation

c)

A selection statement like IF ... END IF

d)

An assignment statement

14.

Which of the following is NOT a computational expression?

a)

score + 1

b)

days < 7

c)

"hello " & "world"

d)

DECLARE

15.

Which symbol is used to represent addition in arithmetic operations?

a)

-

b)

/

c)

+

d)

*

16.

What symbol is used to represent exponentiation in Python?

a)

**

b)

^

c)

*

d)

/

17.

Which arithmetic operator is represented by the symbol '/'?

a)

Addition

b)

Subtraction

c)

Multiplication

d)

Division

18.

In Scratch, how are arithmetic operators visually represented?

a)

As blocks with numbers

b)

As blocks with symbols

c)

As colored circles

d)

As text commands

19.

What does the mnemonic BODMAS stand for?

a)

Brackets, Orders, Division, Multiplication, Addition, Subtraction

b)

Brackets, Operations, Division, Multiplication, Addition, Subtraction

c)

Brackets, Orders, Division, Modulus, Addition, Subtraction

d)

Brackets, Orders, Division, Multiplication, Accumulation, Subtraction

20.

According to BODMAS, which operations have equal precedence?

a)

Division and Addition

b)

Multiplication and Subtraction

c)

Division and Multiplication

d)

Addition and Subtraction

21.

Why would the code:

SET average TO number1 + number2 + number3 / 3

produce the wrong answer when calculating an average?

a)

Because it does not use brackets to alter the order of operations

b)

Because division should be done after addition

c)

Because the variables are not declared properly

d)

Because the division by 3 should be outside the brackets

22.

What is the correct way to calculate the average of number1, number2, and number3 according to BODMAS?

a)

(number1 + number2 + number3) / 3

b)

number1 + number2 + (number3 / 3)

c)

number1 / 3 + number2 / 3 + number3 / 3

d)

number1 + number2 + number3 / 3

23.

What is the correct order of operations to calculate the area of a circle in the given pseudocode?

a)

SEND "Enter the radius of the

ir

le" TO DISPLAY

b)

RECEIVE radius FROM (REAL) KEYBOARD

c)

SET area TO pi * radius ^ 2

d)

SEND "The area of the

ir

le is " & area TO DISPLAY

1)
2)
3)
4)
24.

In the pseudocode provided for calculating the volume of a cuboid, which line of code performs the calculation?

a)

SEND "Enter Length" TO DISPLAY

b)

SET volume TO length * breadth * height

c)

RECEIVE height FROM (INTEGER) KEYBOARD

d)

SEND "The volume of the cuboid is " & volume & " CM3"

25.

What is the purpose of the Scholaria Tax calculator program as described in the learning material?

a)

To calculate the net pay of employees after deductions for tax and national insurance

b)

To calculate the gross pay of employees before deductions

c)

To record employee attendance and calculate overtime

d)

To manage employee schedules and assign tasks

26.

What percentage of income is reserved for National Insurance in Scholaria above £10,000?

a)

5%

b)

7%

c)

20%

d)

10%

27.

What is the term used to describe the technique of joining two or more strings together in programming?

a)

String multiplication

b)

String division

c)

String concatenation

d)

String addition

28.

Which operator is used in the example provided to concatenate strings?

a)

+

b)

&

c)

%

d)

#

29.

According to the example given, how is the volume of a cuboid outputted in the program?

a)

"The volume of the cuboid is " + volume + " CM^3"

b)

"The volume of the cuboid is " & volume & " CM^3"

c)

"The volume of the cuboid is " - volume - " CM^3"

d)

"The volume of the cuboid is " * volume * " CM^3"

30.

What is the purpose of using selection constructs like IF statements in programming?

a)

To repeat a block of code multiple times

b)

To make decisions based on certain conditions

c)

To concatenate strings

d)

To define functions

31.

What will happen if the conditional expression in an IF statement evaluates to TRUE?

a)

The code inside the IF statement will not be executed

b)

The code inside the ELSE section will be executed

c)

The code inside the IF statement will be executed

d)

The program will terminate

32.

What can an IF statement contain to specify an alternative action when the expression is FALSE?

a)

A WHILE loop

b)

An ELSE section

c)

A FOR loop

d)

A SWITCH case

33.

Which of the following is NOT a comparison operator used in IF statements?

a)

<

b)

>=

c)

==

d)

++

34.

What is the initial value of the variable 'age' in the voter validation program?

a)

1

b)

16

c)

0

d)

Undefined

35.

What will the voter validation program display if the age is greater than or equal to 16?

a)

"Please enter your age"

b)

"You cannot vote"

c)

"End"

d)

"You can vote"

36.

Which computational construct is used in the voter validation program to decide whether to display "You can vote"?

a)

WHILE loop

b)

FOR loop

c)

IF statement

d)

SWITCH case

37.

What input does the voter validation program ask from the user?

a)

Their name

b)

Their age

c)

Their voter ID

d)

Their nationality

38.

What happens in the voter validation program if the condition 'age >= 16' evaluates to FALSE?

a)

The program ends without displaying anything.

b)

The program displays "You cannot vote".

c)

The program asks the user to input their age again.

d)

The program displays "You can vote".

39.

What is the first step in the flowchart for the voter validation program in Figure 5.6?

a)

Ask user to input their age

b)

Set age to 0

c)

Display "You can vote"

d)

End

40.

According to the flowchart in Figure 5.6, what happens if the user's age is less than 16?

a)

The program ends without any message

b)

The program displays "You can vote"

c)

The program displays "You cannot vote"

d)

The user is asked to input their age again

41.

What is the advantage of including the ELSE section in the example code shown?

a)

It allows the program to handle multiple conditions

b)

It provides a default action when the IF condition is not met

c)

It makes the program run faster

d)

It is required for the program to compile

42.

What is the minimum age required to apply for a car driving licence in the UK according to the program task provided?

a)

16 years

b)

17 years

c)

18 years

d)

21 years

43.

Which comparison operator is used in Python to determine if two values are equal?

a)

a > b

b)

a = b

c)

a == b

d)

a != b

44.

Which comparison operator is used in Python to determine if one value is not equal to another?

a)

a > b

b)

a == b

c)

a <> b

d)

a != b

45.

Which of the following expressions are TRUE if the value of variable a is 10 and the value of variable b is 11? Select two answers.

a)

a < b

b)

a > b

c)

a != b

d)

a = b

46.

What is the initial value assigned to the variable "password" in the IF statement example?

a)

Enter Password

b)

footb@ll

c)

Login Successful

d)

football

47.

What will be displayed if the user enters a guess that matches the password?

a)

Enter Password

b)

Login Successful

c)

Incorrect Password

d)

Nothing will be displayed

48.

What is the purpose of the line "SET guess TO """ in the program?

a)

To prompt the user to enter a password

b)

To assign a correct password

c)

To display a message to the user

d)

To initialise the guess variable

49.

What happens if the guess does not match the password?

a)

Enter Password

b)

Login Successful

c)

Incorrect Password

d)

The program ends without any message

50.

What happens when the user enters "footb@ll" as a response?

a)

The string "footb@ll" is assigned to the variable password.

b)

The string "footb@ll" is displayed on the screen but not assigned to any variable.

c)

The string "footb@ll" is assigned to the variable guess.

d)

The string "footb@ll" causes an error in the program.

51.

What is the result of the expression (guess == password) when the guess is "footb@ll" and the password is "footb@ll"?

a)

FALSE

b)

NULL

c)

ERROR

d)

TRUE

52.

What happens when the conditional expression in an IF statement evaluates to TRUE?

a)

The main content of the IF statement is skipped.

b)

The ELSE statement is executed.

c)

The main content of the IF statement is executed.

d)

The program immediately ends.

53.

What is displayed if the expression (guess = password) returns FALSE in the given IF construct?

a)

Login Successful

b)

Incorrect Password

c)

Nothing is displayed.

d)

Enter Password

54.

What is the purpose of the END IF keyword in a selection construct?

a)

To repeat the IF statement.

b)

To output a message to the display.

c)

To show that the whole IF construct is finished.

d)

To declare a variable.

55.

What is the correct sequence of code to check if a user has entered the correct answer to a quiz question?

a)

b)

c)

d)

56.

What keyword is used in IF statements to test multiple conditions?

a)

ELSE

b)

ELSE IF

c)

THEN

d)

MULTIPLE IF

57.

According to the example provided, what will happen if the expression (choice = "A") is TRUE?

a)

The program will execute the code for choice B.

b)

The program will stop executing any further code.

c)

The program will execute the code for choice A and not execute any more code.

d)

The program will execute the code for choices A, B and C

58.

Why is using ELSE IF more efficient than using multiple IF statements?

a)

ELSE IF statements are easier to write.

b)

ELSE IF statements process every line of code.

c)

ELSE IF statements prevent the program from testing needless conditions which could never be True

d)

ELSE IF statements can evaluate more expressions.

59.

What is the task of the Score feedback program described in Q13?

a)

To calculate the total score out of 60.

b)

To display a message only if the student fails.

c)

To calculate the percentage and display a pass or fail message based on the score.

d)

To allow the teacher to input multiple student scores at once.

60.

What feature should the Quiz program described in Q14 have?

a)

It should ask the user multiple-choice questions.

b)

It should give the user a point for each correct answer and display the points at the end.

c)

It should allow the user to skip questions.

d)

It should provide hints for each question.

61.

Which of the following logical operators is used to combine two expressions where both must be true for the overall expression to be true?

a)

OR

b)

NOT

c)

AND

d)

XOR

62.

What is the result of the logical expression:

NOT age > 18

if age is 16?

a)

TRUE

b)

FALSE

c)

ERROR

d)

NULL

63.

Logical operators can only be evaluated to which of the following?

a)

Integer values

b)

String values

c)

Boolean values

d)

Floating-point numbers

64.

What is the name of the logic that the logical operators AND, OR, and NOT are derived from?

a)

Algebraic logic

b)

Quantum logic

c)

Boolean logic

d)

Fuzzy logic

65.

What will the program display if the height of a mountain is 3200 ft?

a)

The mountain is a Munro!

b)

The mountain is a Corbett!

c)

The mountain is a Graham!

d)

That, my friend, is just a hill!

66.

What will the program display if the height of a mountain is 2900 ft?

a)

The mountain is a Munro!

b)

The mountain is a Corbett!

c)

The mountain is a Graham!

d)

That, my friend, is just a hill!

67.

What will the program display if the height of a mountain is 2400 ft?

a)

The mountain is a Munro!

b)

The mountain is a Corbett!

c)

The mountain is a Graham!

d)

That, my friend, is just a hill!

68.

What will the program display if the height of a mountain is 1500 ft?

a)

The mountain is a Munro!

b)

The mountain is a Corbett!

c)

The mountain is a Graham!

d)

That, my friend, is just a hill!

69.

How are complex conditions in a selection statement evaluated?

a)
  1. 1. OR

  2. 2. AND

  3. 3. NOT

b)
  1. 1. NOT

  2. 2. OR

    1. 3. AND

c)
  1. 1. NOT

  2. 2. AND

  3. 3. OR

d)
  1. 1. AND

  2. 2. OR

  3. 3. NOT

70.

What is the purpose of using logical operators in programming?

a)

To perform arithmetic calculations.

b)

To build complex conditions in selection statements.

c)

To declare variables.

d)

To display messages to the user.

71.

What is the result of the first sub-expression if the height variable is 2980 in the mountain classification program?

a)

FALSE

b)

TRUE

c)

NULL

d)

0

72.

What is the result of the second sub-expression if the height variable is 2980 in the mountain classification program?

a)

FALSE

b)

TRUE

c)

NULL

d)

0

73.

What is the final result when both sub-expressions are evaluated with the AND operator if the height variable is 2980 in the mountain classification program?

a)

FALSE

b)

TRUE

c)

NULL

d)

0

74.

If the height variable contains the value 1998, what would be the result of evaluating the expression "height >= 2000 AND height < 2500"?

a)

TRUE

b)

FALSE

c)

Cannot be determined from the given information

d)

NULL

75.

If a student scores less than 40%, what feedback message should be displayed?

a)

You have scored ??% - this is a fail

b)

You have scored ??% - this is a D Pass

c)

You have scored ??% - this is a C Pass

d)

You have scored ??% - this is a B Pass

76.

What would be the correct expression to use in the given code fragment to correctly set the air conditioning to come on between 20 and 25 degrees inclusive?

a)

temp > 20 AND temp < 25

b)

temp > 20 OR temp < 25

c)

temp >=20 OR temp <=25

d)

temp >=20 AND temp <=25

77.

What would be the correct expression to use here to test doors, if the alarm sounds when one or other of frontdoor or sidedoor is open?

a)

NOT frontdoor = TRUE AND NOT sidedoor = TRUE

b)

frontdoor = TRUE OR sidedoor = TRUE

c)

frontdoor = TRUE AND sidedoor = TRUE

d)

frontdoor OR sidedoor NOT FALSE

78.

Which two of the following expressions do NOT give the same result as the expression frontdoor = TRUE OR sidedoor = TRUE?

You should choose two answers.

a)

NOT frontdoor = FALSE OR NOT sidedoor = FALSE

b)

frontdoor = TRUE AND sidedoor = FALSE

c)

frontdoor OR sidedoor

d)

NOT frontdoor = FALSE OR sidedoor = FALSE

79.

What is a fixed loop construct used for in programming?

a)

To tell the program how many times to repeat the code inside the construct.

b)

To execute a piece of code only once.

c)

To check a condition before executing a loop.

d)

To create a function that can be called multiple times.

80.

What is missing in the Scratch loop construct compared to the Python and Visual Basic loops?

a)

An inbuilt variable to hold the current number of the repetition

b)

A command to print messages to the console

c)

A syntax to define the start and end of the loop

d)

A feature to execute the loop indefinitely

81.

In the given Python example, what will be printed after the loop finishes?

a)

"all done!"

b)

"times 10 is"

c)

The value of the counter variable

d)

An error message

82.

How is the loop in the Visual Basic example terminated?

a)

With the "END FOR" statement

b)

With the "Next" statement

c)

With the "repeat" block

d)

With the "all done!" print statement

83.

What is the purpose of the second loop in the example of using an array with a loop?

a)

To calculate the average of test scores

b)

To display each test score and its value

c)

To sum up all the test scores

d)

To sort the test scores in ascending order

84.

What initial value is assigned to the 'total' variable? in this example?

a)

1

b)

0

c)

10

d)

0.0

85.

How many times is the loop in the fixed loop example executed?

a)

1 time

b)

3 times

c)

10 times

d)

20 times

86.

What is the data type expected for the 'height' input in the fixed loop example?

a)

INTEGER

b)

STRING

c)

REAL

d)

ARRAY

87.

What does the 'average' variable represent in the fixed loop example?

a)

The sum of all heights

b)

The average test score

c)

The average height

d)

The number of people

88.

What is the first value assigned to the variable 'person' in the fixed loop in Line 3?

a)

0.0

b)

1

c)

2.6

d)

None of the above

89.

Which variable is assigned the real number 2.6 entered by the user?

a)

total

b)

average

c)

person

d)

height

90.

What happens when the expression "total + height" is evaluated in Line 5?

a)

The program increments the variable "person"

b)

The program ends the loop

c)

The variable 'total' is incremented

d)

The user is prompted to enter a number

91.

What does the END FOR command do in Line 6?

a)

It increments the variable "person"

b)

It prompts the user to enter a number

c)

It tells the program to end the loop and not return to the start

d)

It tells the program this is the end of the block of code to repeat

92.

What is the value of the variable "person" at the start of the second repetiton of the loop which starts on Line 3?

a)

1

b)

2

c)

0

d)

The value is not changed

93.

What action is described in Line 4?

a)

The total + height expression is evaluated

b)

The END FOR command is executed

c)

The loop is started for the first time

d)

The user is prompted to enter a number

94.

What is the result of the expression 'total + height' when 'total' is 2.6 and 'height' is 1.8?

a)

3.4

b)

4.0

c)

4.4

d)

2.8

95.

What happens to the 'person' variable after the loop in line 3 starts again?

a)

It is reset to 0.

b)

It is decremented by 1.

c)

It is incremented by 1.

d)

It remains unchanged.