Programming Construct Identification 3 (1 mark)
What programming construct is primarily demonstrated in the code snippet shown below? print(“Hello, World!”) x = 10 + 5 print(x)
Programming Construct Identification 3 (1 mark) Read More »
What programming construct is primarily demonstrated in the code snippet shown below? print(“Hello, World!”) x = 10 + 5 print(x)
Programming Construct Identification 3 (1 mark) Read More »
What programming construct is used in the code snippet shown below? if temperature > 30: print(“It’s a hot day.”) else: print(“It’s not a hot day.”)
Programming Construct Identification 2 (1 mark) Read More »
What programming construct is used in the code snippet shown below? for i 0 to 5 print(i) next i
Programming Construct Identification 1 (1 mark) Read More »
Explain the result of the Boolean expression (NOT A AND B) OR (A AND NOT B) where A = True and B = False.
Boolean Logic. (2 marks) Read More »
Given the expression: 9 * (3 + x) > 50 a) What is the role of the parentheses in this expression? b) Explain what this expression represents. c) List the operators used in this expression.
Operators and Expressions. (3 marks) Read More »
Consider a scenario where a program keeps track of the score of a game and the maximum possible score. Define what you would use as a variable and what as a constant, and explain your reasoning. a) What would you define as a variable? b) What would you define as a constant?
Variables and Constants. (2 marks) Read More »
Describe the Insertion Sort process using a simple array of integers [8, 3, 5, 4] as an example. Explain how elements are sorted step-by-step.
Basic Explanation of Insertion Sort. (3 marks) Read More »
Explain how the Merge Sort algorithm sorts a dataset.
Process of the Merge Sort Algorithm. (3 marks) Read More »
Describe the process of the Bubble Sort algorithm when applied to a set of numbers.
Describe the process of the Bubble Sort. (2 marks) Read More »
A list of student names sorted alphabetically: Alice, Bob, Charlie, David, Emma. Write the steps you would take to find the name “Emma” using a binary search.
Applying a Binary Search Algorithm. (3 marks) Read More »