String Methods: Length (1 mark)
Identify the operation that would be used to find the number of characters in a string variable ‘username’.
String Methods: Length (1 mark) Read More »
Identify the operation that would be used to find the number of characters in a string variable ‘username’.
String Methods: Length (1 mark) Read More »
Given a string variable ‘filePath’ containing the text “C:/User/Docs/Report.docx”, write a statement that uses string handling operations to extract the file extension from ‘filePath’.
String Methods: Substring (2 mark) Read More »
Describe how a two-dimensional array differs from a one-dimensional array.
1D vs 2D Arrays (3 marks) Read More »
Define a record ‘Student’ with the following fields: name (string), age (integer), and grade (character).
Identify what is meant by the term “input” in the context of computer systems.
What is an Input? (1 mark) Read More »
Explain why it is important for a program to validate user input from the keyboard.
Validating Inputs (2 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 »
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 »
Write the output of the following Boolean expression: NOT (True AND False)
Evaluating a Boolean Expression (1 mark) Read More »