Records (4 marks)
Define a record ‘Student’ with the following fields: name (string), age (integer), and grade (character).
Define a record ‘Student’ with the following fields: name (string), age (integer), and grade (character).
Describe how a two-dimensional array differs from a one-dimensional array.
1D vs 2D Arrays (3 marks) Read More »
Given the following one-dimensional array of integers: numbers
1D Array Index (2 marks) Read More »
Explain what an array is in the context of data structures.
What is an Array (1 mark) Read More »
A program includes the following Boolean variables to control its flow: userLoggedIn isAdmin hasPermissions Write a Boolean expression that will be evaluated to True to allow access to the admin panel, considering that access should only be granted if the user is logged in and is either an admin or has permissions.
Construct a Boolean Expression (1 mark) Read More »
Consider the following variables: a = True b = False c = True What will be the result of the expression (NOT a) OR (b AND c)?
Evaluating Boolean Expressions (2 mark) Read More »
Write the output of the following Boolean expression: NOT (True AND False)
Evaluating a Boolean Expression (1 mark) Read More »
Write a code snippet that uses relational operators to check if the user’s input for a variable score is greater than or equal to 50 but less than 100. Also include a comment explaining what each part of the condition is checking.
Greater and Less Than Operators (4 marks) Read More »
Identify which relational operator would be used in a program to determine if a variable x has a value that is not equal to 10.
Not Equal Relational Operator (1 mark) Read More »
If a variable totalCost is ‘75.5’ and numberOfItems is ‘7’, write the pseudocode to calculate the average cost per item. Explain how real division is used in your pseudocode.
Real Division (4 marks) Read More »
Notifications