Font size
WorksheetsN5 Computing Science: Computational Constructs
Total questions: 95
Worksheet time: 49mins
Which of the following program constructs is NOT required for N5 Computing Science?
Values can be stored in variables.
Arithmetic operators can be used on numerical values.
Repetition constructs can be used to repeat blocks of code.
Using switch-case statements to handle multiple conditions.
What should you be able to describe and use by the end of the topic on Computational Constructs?
Expressions to assign values to variables.
How to use social media platforms.
The history of programming languages.
Techniques for effective internet search.
Which of the following is NOT listed as a predefined function in a programming environment that you should be familiar with?
random
round
length
abs
What type of constructs should you be able to use for creating simple conditions?
Selection constructs like IF statements
Repetition constructs like FOR loops
Assignment constructs like variable declaration
Exception handling constructs like TRY-CATCH
Which of these logical operators is NOT included in N5 Computing Science?
AND
OR
XOR
NOT
What would the following line of code do?
SET answer TO 100 / 4
Divide 100 by 4 and store the result in the answer variable.
Multiply 100 by 4 and store the result in the answer variable.
Store the characters "100 / 4" in the answer variable.
Crash the program as the translator would not recognise the "/" symbol.
How many times would the phrase "Hello World" appear on screen if the following code was run?
1
5
6
10
When would the message "pass" be displayed when the following code is run?
When the score variable's value is less than 10.
When the score variable's value is greater than 10.
When the score variable's value is equal to 10.
It will always be displayed.
Which of the following is NOT a building blocks of a programming language that you should be familiar with for N5 Computing Science ?
Keywords
Constructs
Functions
Variables (and arrays)
What is the purpose of an assignment statement in programming?
To perform a calculation
To store an item of data in a variable
To compare two values
To execute a program
How many different types of arithmetic operators are there?
Two
Three
Four
Five
What is an expression in programming?
A command to execute an action
A set of instructions for a loop
A combination of data items, operators, and fixed values that need to be computed
A declaration of a variable
Which of the following is an example of a programming construct?
A variable declaration
An arithmetic operation
A selection statement like IF ... END IF
An assignment statement
Which of the following is NOT a computational expression?
score + 1
days < 7
"hello " & "world"
DECLARE
Which symbol is used to represent addition in arithmetic operations?
-
/
+
*
What symbol is used to represent exponentiation in Python?
**
^
*
/
Which arithmetic operator is represented by the symbol '/'?
Addition
Subtraction
Multiplication
Division
In Scratch, how are arithmetic operators visually represented?
As blocks with numbers
As blocks with symbols
As colored circles
As text commands
What does the mnemonic BODMAS stand for?
Brackets, Orders, Division, Multiplication, Addition, Subtraction
Brackets, Operations, Division, Multiplication, Addition, Subtraction
Brackets, Orders, Division, Modulus, Addition, Subtraction
Brackets, Orders, Division, Multiplication, Accumulation, Subtraction
According to BODMAS, which operations have equal precedence?
Division and Addition
Multiplication and Subtraction
Division and Multiplication
Addition and Subtraction
Why would the code:
SET average TO number1 + number2 + number3 / 3
produce the wrong answer when calculating an average?
Because it does not use brackets to alter the order of operations
Because division should be done after addition
Because the variables are not declared properly
Because the division by 3 should be outside the brackets
What is the correct way to calculate the average of number1, number2, and number3 according to BODMAS?
(number1 + number2 + number3) / 3
number1 + number2 + (number3 / 3)
number1 / 3 + number2 / 3 + number3 / 3
number1 + number2 + number3 / 3
What is the correct order of operations to calculate the area of a circle in the given pseudocode?
SEND "Enter the radius of the
ir
le" TO DISPLAY
RECEIVE radius FROM (REAL) KEYBOARD
SET area TO pi * radius ^ 2
SEND "The area of the
ir
le is " & area TO DISPLAY
In the pseudocode provided for calculating the volume of a cuboid, which line of code performs the calculation?
SEND "Enter Length" TO DISPLAY
SET volume TO length * breadth * height
RECEIVE height FROM (INTEGER) KEYBOARD
SEND "The volume of the cuboid is " & volume & " CM3"
What is the purpose of the Scholaria Tax calculator program as described in the learning material?
To calculate the net pay of employees after deductions for tax and national insurance
To calculate the gross pay of employees before deductions
To record employee attendance and calculate overtime
To manage employee schedules and assign tasks
What percentage of income is reserved for National Insurance in Scholaria above £10,000?
5%
7%
20%
10%
What is the term used to describe the technique of joining two or more strings together in programming?
String multiplication
String division
String concatenation
String addition
Which operator is used in the example provided to concatenate strings?
+
&
%
#
According to the example given, how is the volume of a cuboid outputted in the program?
"The volume of the cuboid is " + volume + " CM^3"
"The volume of the cuboid is " & volume & " CM^3"
"The volume of the cuboid is " - volume - " CM^3"
"The volume of the cuboid is " * volume * " CM^3"
What is the purpose of using selection constructs like IF statements in programming?
To repeat a block of code multiple times
To make decisions based on certain conditions
To concatenate strings
To define functions
What will happen if the conditional expression in an IF statement evaluates to TRUE?
The code inside the IF statement will not be executed
The code inside the ELSE section will be executed
The code inside the IF statement will be executed
The program will terminate
What can an IF statement contain to specify an alternative action when the expression is FALSE?
A WHILE loop
An ELSE section
A FOR loop
A SWITCH case
Which of the following is NOT a comparison operator used in IF statements?
<
>=
==
++
What is the initial value of the variable 'age' in the voter validation program?
1
16
0
Undefined
What will the voter validation program display if the age is greater than or equal to 16?
"Please enter your age"
"You cannot vote"
"End"
"You can vote"
Which computational construct is used in the voter validation program to decide whether to display "You can vote"?
WHILE loop
FOR loop
IF statement
SWITCH case
What input does the voter validation program ask from the user?
Their name
Their age
Their voter ID
Their nationality
What happens in the voter validation program if the condition 'age >= 16' evaluates to FALSE?
The program ends without displaying anything.
The program displays "You cannot vote".
The program asks the user to input their age again.
The program displays "You can vote".
What is the first step in the flowchart for the voter validation program in Figure 5.6?
Ask user to input their age
Set age to 0
Display "You can vote"
End
According to the flowchart in Figure 5.6, what happens if the user's age is less than 16?
The program ends without any message
The program displays "You can vote"
The program displays "You cannot vote"
The user is asked to input their age again
What is the advantage of including the ELSE section in the example code shown?
It allows the program to handle multiple conditions
It provides a default action when the IF condition is not met
It makes the program run faster
It is required for the program to compile
What is the minimum age required to apply for a car driving licence in the UK according to the program task provided?
16 years
17 years
18 years
21 years
Which comparison operator is used in Python to determine if two values are equal?
a > b
a = b
a == b
a != b
Which comparison operator is used in Python to determine if one value is not equal to another?
a > b
a == b
a <> b
a != b
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 < b
a > b
a != b
a = b
What is the initial value assigned to the variable "password" in the IF statement example?
Enter Password
footb@ll
Login Successful
football
What will be displayed if the user enters a guess that matches the password?
Enter Password
Login Successful
Incorrect Password
Nothing will be displayed
What is the purpose of the line "SET guess TO """ in the program?
To prompt the user to enter a password
To assign a correct password
To display a message to the user
To initialise the guess variable
What happens if the guess does not match the password?
Enter Password
Login Successful
Incorrect Password
The program ends without any message
What happens when the user enters "footb@ll" as a response?
The string "footb@ll" is assigned to the variable password.
The string "footb@ll" is displayed on the screen but not assigned to any variable.
The string "footb@ll" is assigned to the variable guess.
The string "footb@ll" causes an error in the program.
What is the result of the expression (guess == password) when the guess is "footb@ll" and the password is "footb@ll"?
FALSE
NULL
ERROR
TRUE
What happens when the conditional expression in an IF statement evaluates to TRUE?
The main content of the IF statement is skipped.
The ELSE statement is executed.
The main content of the IF statement is executed.
The program immediately ends.
What is displayed if the expression (guess = password) returns FALSE in the given IF construct?
Login Successful
Incorrect Password
Nothing is displayed.
Enter Password
What is the purpose of the END IF keyword in a selection construct?
To repeat the IF statement.
To output a message to the display.
To show that the whole IF construct is finished.
To declare a variable.
What is the correct sequence of code to check if a user has entered the correct answer to a quiz question?
What keyword is used in IF statements to test multiple conditions?
ELSE
ELSE IF
THEN
MULTIPLE IF
According to the example provided, what will happen if the expression (choice = "A") is TRUE?
The program will execute the code for choice B.
The program will stop executing any further code.
The program will execute the code for choice A and not execute any more code.
The program will execute the code for choices A, B and C
Why is using ELSE IF more efficient than using multiple IF statements?
ELSE IF statements are easier to write.
ELSE IF statements process every line of code.
ELSE IF statements prevent the program from testing needless conditions which could never be True
ELSE IF statements can evaluate more expressions.
What is the task of the Score feedback program described in Q13?
To calculate the total score out of 60.
To display a message only if the student fails.
To calculate the percentage and display a pass or fail message based on the score.
To allow the teacher to input multiple student scores at once.
What feature should the Quiz program described in Q14 have?
It should ask the user multiple-choice questions.
It should give the user a point for each correct answer and display the points at the end.
It should allow the user to skip questions.
It should provide hints for each question.
Which of the following logical operators is used to combine two expressions where both must be true for the overall expression to be true?
OR
NOT
AND
XOR
What is the result of the logical expression:
NOT age > 18
if age is 16?
TRUE
FALSE
ERROR
NULL
Logical operators can only be evaluated to which of the following?
Integer values
String values
Boolean values
Floating-point numbers
What is the name of the logic that the logical operators AND, OR, and NOT are derived from?
Algebraic logic
Quantum logic
Boolean logic
Fuzzy logic
What will the program display if the height of a mountain is 3200 ft?
The mountain is a Munro!
The mountain is a Corbett!
The mountain is a Graham!
That, my friend, is just a hill!
What will the program display if the height of a mountain is 2900 ft?
The mountain is a Munro!
The mountain is a Corbett!
The mountain is a Graham!
That, my friend, is just a hill!
What will the program display if the height of a mountain is 2400 ft?
The mountain is a Munro!
The mountain is a Corbett!
The mountain is a Graham!
That, my friend, is just a hill!
What will the program display if the height of a mountain is 1500 ft?
The mountain is a Munro!
The mountain is a Corbett!
The mountain is a Graham!
That, my friend, is just a hill!
How are complex conditions in a selection statement evaluated?
1. OR
2. AND
3. NOT
1. NOT
2. OR
3. AND
1. NOT
2. AND
3. OR
1. AND
2. OR
3. NOT
What is the purpose of using logical operators in programming?
To perform arithmetic calculations.
To build complex conditions in selection statements.
To declare variables.
To display messages to the user.
What is the result of the first sub-expression if the height variable is 2980 in the mountain classification program?
FALSE
TRUE
NULL
0
What is the result of the second sub-expression if the height variable is 2980 in the mountain classification program?
FALSE
TRUE
NULL
0
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?
FALSE
TRUE
NULL
0
If the height variable contains the value 1998, what would be the result of evaluating the expression "height >= 2000 AND height < 2500"?
TRUE
FALSE
Cannot be determined from the given information
NULL
If a student scores less than 40%, what feedback message should be displayed?
You have scored ??% - this is a fail
You have scored ??% - this is a D Pass
You have scored ??% - this is a C Pass
You have scored ??% - this is a B Pass
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?
temp > 20 AND temp < 25
temp > 20 OR temp < 25
temp >=20 OR temp <=25
temp >=20 AND temp <=25
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?
NOT frontdoor = TRUE AND NOT sidedoor = TRUE
frontdoor = TRUE OR sidedoor = TRUE
frontdoor = TRUE AND sidedoor = TRUE
frontdoor OR sidedoor NOT FALSE
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.
NOT frontdoor = FALSE OR NOT sidedoor = FALSE
frontdoor = TRUE AND sidedoor = FALSE
frontdoor OR sidedoor
NOT frontdoor = FALSE OR sidedoor = FALSE
What is a fixed loop construct used for in programming?
To tell the program how many times to repeat the code inside the construct.
To execute a piece of code only once.
To check a condition before executing a loop.
To create a function that can be called multiple times.
What is missing in the Scratch loop construct compared to the Python and Visual Basic loops?
An inbuilt variable to hold the current number of the repetition
A command to print messages to the console
A syntax to define the start and end of the loop
A feature to execute the loop indefinitely
In the given Python example, what will be printed after the loop finishes?
"all done!"
"times 10 is"
The value of the counter variable
An error message
How is the loop in the Visual Basic example terminated?
With the "END FOR" statement
With the "Next" statement
With the "repeat" block
With the "all done!" print statement
What is the purpose of the second loop in the example of using an array with a loop?
To calculate the average of test scores
To display each test score and its value
To sum up all the test scores
To sort the test scores in ascending order
What initial value is assigned to the 'total' variable? in this example?
1
0
10
0.0
How many times is the loop in the fixed loop example executed?
1 time
3 times
10 times
20 times
What is the data type expected for the 'height' input in the fixed loop example?
INTEGER
STRING
REAL
ARRAY
What does the 'average' variable represent in the fixed loop example?
The sum of all heights
The average test score
The average height
The number of people
What is the first value assigned to the variable 'person' in the fixed loop in Line 3?
0.0
1
2.6
None of the above
Which variable is assigned the real number 2.6 entered by the user?
total
average
person
height
What happens when the expression "total + height" is evaluated in Line 5?
The program increments the variable "person"
The program ends the loop
The variable 'total' is incremented
The user is prompted to enter a number
What does the END FOR command do in Line 6?
It increments the variable "person"
It prompts the user to enter a number
It tells the program to end the loop and not return to the start
It tells the program this is the end of the block of code to repeat
What is the value of the variable "person" at the start of the second repetiton of the loop which starts on Line 3?
1
2
0
The value is not changed
What action is described in Line 4?
The total + height expression is evaluated
The END FOR command is executed
The loop is started for the first time
The user is prompted to enter a number
What is the result of the expression 'total + height' when 'total' is 2.6 and 'height' is 1.8?
3.4
4.0
4.4
2.8
What happens to the 'person' variable after the loop in line 3 starts again?
It is reset to 0.
It is decremented by 1.
It is incremented by 1.
It remains unchanged.
