Evaluating Boolean Expressions (2 mark)
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 »
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 »
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 »
Write a pseudocode statement that assigns the product of two variables, length and width, to a new variable called ‘area’.
Arithmetic Operations (1 mark) Read More »
Given two integer variables, ‘dividend’ being 25 and ‘divisor’ being 4, write the pseudocode to calculate and output both the result of the integer division and the remainder.
Integer Division (3 marks) 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 »
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 »
Explain why meaningful identifier names are important when programming. Provide two reasons in your answer.
Identifiers in Programming (2 marks) Read More »
Explain the purpose of an assignment statement in a computer program.
Variable Assignment (1 Mark) Read More »
Write a code segment using definite iteration that prints the numbers 1 to 10 in descending order, but only prints the number if it is even.
Iteration and Selection (3 Marks) Read More »
Define a subroutine called CalculateVolume that takes two parameters, height and radius, and calculates the volume of a cylinder. The formula for volume is πr²h.
Subroutine (2 Marks) Read More »