Junior Secondary · Computer Literacy / Information & Communication Technology

Data manipulation: Practice Questions

5 multiple-choice questions marked as you go, and 5 written questions with worked solutions. All on Data manipulation.

10 questions27 marksFree, no account
Question 1
1 mark

In a programming environment, which of the following relational operators is used to check if two values are NOT equal to each other?

Question 2
1 mark

Consider the following logical expression used in a program flow control:
(score >= 50) AND (score < 80)
If the variable score is exactly 50, what is the boolean result of this expression?

Question 3
1 mark

A loop is designed to simulate rolling a standard 6-sided die until a \( 6 \) is rolled. If the random number generator function random(1, 6) is used, which logical condition should be placed in a WHILE loop to ensure it continues as long as the result is not \( 6 \)?

Question 4
1 mark

A program uses three variables: A = 12, B = 5, and C = 2. What is the final value of variable result after executing the following operations in order?

1. result = A + B * C
2. result = result - (A / C)

Question 5
1 mark

To create an arithmetic quiz, a program generates two random integers \( a \) and \( b \) between \( 1 \) and \( 10 \). It then asks the user for the answer to \( a \times b \). Which of the following relational operators is most appropriate to check if the user's input ans is correct?

Question 6
3 marks

In a programming environment, what is the resulting boolean value of the logical expression (5 > 3) AND (10 < 7)? Briefly explain your answer.

Write your answer out first, then check it against the worked solution.

Question 7
6 marks

Consider a program that evaluates a student's grade. If a student needs a score of at least 50 to pass and less than 50 to fail, which two relational operators should be used to represent these two conditions respectively? Describe how these operators help the program decide the output.

Write your answer out first, then check it against the worked solution.

Question 8
3 marks

Suppose a program uses a variable score initially set to 10. If the command score = score * 2 + 5 is executed, what is the new value of score? Show the calculation.

Write your answer out first, then check it against the worked solution.

Question 9
4 marks

A student is writing a simple program to calculate the average score of a class. The program uses a loop to accept the scores of 5 students from the keyboard and then calculates the result.

(a) Identify the relational operator that would be used in a loop condition to ensure it runs exactly 5 times if the counter starts at 1.
(b) If the five scores entered are 80, 70, 90, 60, and 100, what is the final value of the variable used to store the sum of scores?
(c) The student wants to display a message "Pass" if the average is 50 or above, and "Fail" otherwise. Name the logical operator or flow control statement needed to implement this decision.

Write your answer out first, then check it against the worked solution.

Question 10
6 marks

Consider the following pseudocode for a program designed to manipulate text strings and numbers:

SET total = 0
FOR count = 1 TO 3
  INPUT num
  IF num > 10 AND num < 20 THEN
    SET total = total + num
  END IF
NEXT count
PRINT "Final result: " + total

(a) Identify the logical operator used in the code and explain its function in this specific context.
(b) If the user inputs the values 15, 5, and 12, calculate the final value of the variable total.
(c) How does the program use input and output features to interact with the user?
(d) Suggest one text string manipulation effect that could be added to the output to make the result more visually interesting for the user.

Write your answer out first, then check it against the worked solution.

* The content provided by thinka is generated by AI and may not always be accurate or up-to-date. Please use it as a supplementary resource and verify with official materials.

You've seen the model answer. Now get yours marked.

This page can show you how a good answer looks. It cannot tell you what your answer was missing. thinka marks your written work against the real mark scheme in about 15 seconds.

Want more questions like these? Get a fresh set on this topic, marked as you go.

Practise More