Home / Worksheets / Grade 12 / Science / Grade 12 Programming Fundamentals Worksheet

Grade 12 Programming Fundamentals Worksheet

This worksheet covers fundamental concepts in programming for Grade 12 students, including data types, control structures, and object-oriented programming principles.

Grade 12 Science Computer ScienceProgramming
Use This Worksheet

Includes

Multiple ChoiceFill in the BlanksTrue / FalseShort AnswerCustom

Standards

HS-ETS1-2HS-ETS1-3

Topics

programmingcomputer sciencegrade 12algorithmsdata structures
7 sections · Free to use · Printable
← More Science worksheets for Grade 12

Programming Fundamentals

Name:

Date:

Score:

Read each question carefully and answer to the best of your ability. Show all your work for coding-related questions.

1. Which of the following is NOT a fundamental data type in most programming languages?

a

Integer

b

Boolean

c

Array

d

String

2. What is the primary purpose of a 'for' loop in programming?

a

To define a function

b

To make a decision based on a condition

c

To iterate over a sequence of elements

d

To declare a variable

3. The concept of   allows objects of different classes to be treated as objects of a common base class.

4. A   is a set of instructions that tells a computer how to perform a specific task.

5. In object-oriented programming,   refers to the bundling of data and methods that operate on the data within a single unit.

6. Python is an example of a compiled programming language.

T

True

F

False

7. An algorithm must always produce a correct output.

T

True

F

False

8. Briefly explain the difference between a high-level and a low-level programming language.

9. Describe the concept of 'inheritance' in object-oriented programming with an example.

10. Analyze the following Python code snippet. What will be the output?

```python def factorial(n): if n == 0: return 1 else: return n * factorial(n-1) print(factorial(4)) ```

Explain your reasoning: