Computer Programming Practice Tests

These Grade 10 Additional Subjects practice tests introduce algorithms, variables, data types, input and output, conditionals, loops, functions, collections, debugging, testing, efficiency, cybersecurity, privacy, accessibility, and ethical programming.

Skills covered

  • Explaining algorithms, variables, data types, syntax, input, output, comments, abstraction, and operators
  • Tracing conditionals, for loops, while loops, Boolean expressions, nesting, and stopping conditions
  • Using functions, parameters, arguments, return values, lists, indexes, dictionaries, strings, and scope
  • Distinguishing syntax, runtime, and logic errors and applying testing, decomposition, pseudocode, readability, and efficiency
  • Understanding personal data, encryption, authentication, authorization, algorithmic bias, accessibility, open-source software, and phishing

How to use these practice tests

Trace the program one step at a time. Identify the data type and control structure, then check the expected output, edge cases, and security or ethical effects when the question involves real users.

For more Grade 10 Additional Subjects practice, return to the Grade 10 Additional Subjects category.

3. Test

Grade 10 Computer Programming Practice Tests

Practice Grade 10 Additional Subjects questions about algorithms, variables, data types, control flow, functions, data structures, debugging, efficiency, security, privacy, and ethical programming.

Choose the best answer. Trace program logic, distinguish errors, identify data and control structures, and consider security, privacy, accessibility, and ethical impact.

10 Questions
0/10 Questions0 %
Correct 0
Incorrect 0
Unanswered 10
1. QuestionMultiple choice

What is a function?

Please select an answer first.

Correct answer: A

The correct answer is A named, reusable block of code that performs a task.

  1. Identify the programming concept: Determine whether the question asks about an algorithm, data, control flow, a function, debugging, efficiency, security, or ethics.
  2. Trace the logic: Functions organize code into reusable units and can accept inputs and produce outputs.
  3. Check the conclusion: The correct answer is A named, reusable block of code that performs a task.

Functions organize code into reusable units and can accept inputs and produce outputs.

2. QuestionMultiple choice

What is a parameter?

Please select an answer first.

Correct answer: B

The correct answer is A named input listed in a function definition.

  1. Identify the programming concept: Determine whether the question asks about an algorithm, data, control flow, a function, debugging, efficiency, security, or ethics.
  2. Trace the logic: A parameter is a placeholder that receives a value when the function is called.
  3. Check the conclusion: The correct answer is A named input listed in a function definition.

A parameter is a placeholder that receives a value when the function is called.

3. QuestionMultiple choice

What is an argument?

Please select an answer first.

Correct answer: C

The correct answer is The actual value passed to a function when it is called.

  1. Identify the programming concept: Determine whether the question asks about an algorithm, data, control flow, a function, debugging, efficiency, security, or ethics.
  2. Trace the logic: An argument supplies the value that corresponds to a function parameter.
  3. Check the conclusion: The correct answer is The actual value passed to a function when it is called.

An argument supplies the value that corresponds to a function parameter.

4. QuestionMultiple choice

What does a return statement do?

Please select an answer first.

Correct answer: D

The correct answer is It sends a result from a function back to the calling code..

  1. Identify the programming concept: Determine whether the question asks about an algorithm, data, control flow, a function, debugging, efficiency, security, or ethics.
  2. Trace the logic: Return makes a function's computed value available to the code that called it.
  3. Check the conclusion: The correct answer is It sends a result from a function back to the calling code..

Return makes a function's computed value available to the code that called it.

5. QuestionMultiple choice

What is a list or array?

Please select an answer first.

Correct answer: A

The correct answer is An ordered collection of values.

  1. Identify the programming concept: Determine whether the question asks about an algorithm, data, control flow, a function, debugging, efficiency, security, or ethics.
  2. Trace the logic: Lists store multiple elements in an order so a program can access, update, and process them.
  3. Check the conclusion: The correct answer is An ordered collection of values.

Lists store multiple elements in an order so a program can access, update, and process them.

6. QuestionMultiple choice

What is an index?

Please select an answer first.

Correct answer: B

The correct answer is A position used to access an item in a sequence.

  1. Identify the programming concept: Determine whether the question asks about an algorithm, data, control flow, a function, debugging, efficiency, security, or ethics.
  2. Trace the logic: An index identifies an element's location in a list or string; many languages begin counting at zero.
  3. Check the conclusion: The correct answer is A position used to access an item in a sequence.

An index identifies an element's location in a list or string; many languages begin counting at zero.

7. QuestionMultiple choice

What is a dictionary or map data structure?

Please select an answer first.

Correct answer: C

The correct answer is A collection that associates keys with values.

  1. Identify the programming concept: Determine whether the question asks about an algorithm, data, control flow, a function, debugging, efficiency, security, or ethics.
  2. Trace the logic: Key-value structures allow a program to retrieve data using a meaningful key.
  3. Check the conclusion: The correct answer is A collection that associates keys with values.

Key-value structures allow a program to retrieve data using a meaningful key.

8. QuestionMultiple choice

What is string concatenation?

Please select an answer first.

Correct answer: D

The correct answer is Joining strings together.

  1. Identify the programming concept: Determine whether the question asks about an algorithm, data, control flow, a function, debugging, efficiency, security, or ethics.
  2. Trace the logic: Concatenation combines text values into a longer string.
  3. Check the conclusion: The correct answer is Joining strings together.

Concatenation combines text values into a longer string.

9. QuestionMultiple choice

Why are functions useful in a larger program?

Please select an answer first.

Correct answer: A

The correct answer is They reduce repetition, improve organization, and make testing easier..

  1. Identify the programming concept: Determine whether the question asks about an algorithm, data, control flow, a function, debugging, efficiency, security, or ethics.
  2. Trace the logic: Reusable functions support decomposition, readability, maintenance, and focused testing.
  3. Check the conclusion: The correct answer is They reduce repetition, improve organization, and make testing easier..

Reusable functions support decomposition, readability, maintenance, and focused testing.

10. QuestionMultiple choice

What is a scope of a variable?

Please select an answer first.

Correct answer: B

The correct answer is The part of a program where the variable can be accessed.

  1. Identify the programming concept: Determine whether the question asks about an algorithm, data, control flow, a function, debugging, efficiency, security, or ethics.
  2. Trace the logic: Scope determines where a name is visible and helps prevent unrelated parts of a program from changing it unexpectedly.
  3. Check the conclusion: The correct answer is The part of a program where the variable can be accessed.

Scope determines where a name is visible and helps prevent unrelated parts of a program from changing it unexpectedly.