Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Pearson 1CP2 - 1.1 - Good Programming Practice and IDEs

Total questions: 30

Worksheet time: 15mins

Name
Class
Date
1.

What is the purpose of autocomplete in an Integrated Development Environment (IDE)?

a)

To check the syntax of the code

b)

To help reduce the number of errors by suggesting possible word completions

c)

To automatically indent code after typing a colon

d)

To highlight different parts of the syntax

2.

What does auto-indentation in an IDE help with when writing Python code?

a)

It suggests variable names that don't exist.

b)

It automatically indents the code after typing a colon, which is part of Python's syntax.

c)

It checks for missing brackets or quotes in the code.

d)

It provides suggestions for reserved words.

3.

Which of the following is NOT a type of error that syntax checking in an IDE might highlight?

a)

Misspelling key words

b)

Using identifier names that don't exist

c)

Suggesting words in a pop-up window

d)

Missing colons

4.

Which option best describes the role of syntax in programming languages?

a)

The color scheme used in an IDE to highlight code

b)

The library of functions available in a programming language

c)

The rules governing the structure and composition of statements in a programming language

d)

The efficiency of algorithms implemented in a programming language

5.

Which feature of an IDE allows for the examination and modification of variables during the execution of a program?

a)

To compile code more efficiently

b)

To refactor code automatically

c)

Stepping through code

d)

To manage project files and resources

6.

What happens when a breakpoint is set on a line in a program?

a)

The program will skip the line and continue execution

b)

The program will terminate immediately

c)

The program will pause before executing the line

d)

The program will execute the line multiple times

7.

What does the IDE display when a program is paused on a breakpoint?

a)

A red 'stop' icon

b)

A green 'run' icon

c)

A green bug icon

d)

The line with the breakpoint highlighted

8.

What is the purpose of the 'Step over' action in a debugger?

a)

To execute the entire program until it completes

b)

To execute the current line and move to the next line without entering any subprograms

c)

To terminate the program immediately

d)

To continue execution until the next breakpoint is encountered

9.

What happens when you use the 'Step into' action in a debugger?

a)

The debugger will move to the next line of code outside the current subprogram

b)

The debugger will pause the program execution permanently

c)

The debugger will execute the current line and enter the called subprogram

d)

The debugger will skip over the execution of the current line

10.

Which type of error doesn't relate to the way code has been produced.

a)

Syntax errors

b)

Runtime errors

c)

Logic errors

d)

Network errors

11.

What type of error occurs when brackets aren't closed?

a)

Syntax error

b)

Type error

c)

Compilation error

d)

Execution error

12.

What does IDE stand for in the context of programming?

a)

Integrated Development Environment

b)

Internal Drive Engine

c)

Intelligent Design Entity

d)

Interactive Development Execution

13.

What type of error occurs when a programmer instructs the computer to do an operation but provides incompatible types, such as adding a number and a word?

a)

Syntax error

b)

Indentation error

c)

Type error

d)

Name error

14.

How can you fix an indentation error in your code?

a)

By changing the types of the data to be compatible

b)

By only indenting the lines necessary to implement your logic and indent them to the correct level

c)

By using an identifier that the interpreter recognizes

d)

By ensuring all variables are initialized before use

15.

Which of the following is an example of a type error correction?

a)

count = 0; count = count + "Fred"

b)

count = 0; count = count + 1

c)

count = 0; count = lives + 33

d)

count = 0; count = count + "1"

16.

What type of error occurs when you try to use a variable that has not been defined?

a)

SyntaxError

b)

IndexError

c)

NameError

d)

ZeroDivisionError

17.

How can a NameError be fixed in Python?

a)

By resetting the value of count

b)

By ensuring the variable is defined before it is used

c)

By dividing the variable by zero

d)

By spelling the variable name incorrectly

18.

What is the result of a ZeroDivisionError in Python?

a)

The program executes successfully

b)

The variable becomes undefined

c)

The program crashes because a variable is divided by zero

d)

The variable is automatically set to zero

19.

What is version control in the context of programming?

a)

A system for keeping copies of code and getting them working in the same file with a new name

b)

A database for storing user credentials

c)

A method to control the version of the operating system

d)

A strategy to avoid data loss by storing files on separate servers

20.

What is the first step in the problem-solving process according to the text?

a)

Algorithm design

b)

Abstraction

c)

Decomposition

d)

Implementation

21.

What does decomposition in computational thinking involve?

a)

Breaking a problem into smaller, more manageable parts

b)

Removing unnecessary details from a problem

c)

Creating algorithms for each part of the problem

d)

Working on different parts of the problem at the same time

22.

Why is abstraction used when creating algorithms?

a)

To make the algorithm run faster

b)

To ensure the algorithm is easy to understand

c)

To focus on the essential details and ignore the non-essential ones

d)

To make the algorithm more complex

23.

Which of the following is a form of abstraction in computer science?

a)

Using a physical map to navigate a city

b)

Writing a program that simulates weather patterns

c)

Describing the taste of an apple

d)

Organizing books on a shelf by genre

24.

What is NOT considered when using abstraction to represent a die in a computer game?

a)

The number of sides on the die

b)

The shape of the die

c)

The color of the dots on the die

d)

The random number generated to simulate a die roll

25.

What is the purpose of abstraction in programming?

a)

To increase the complexity of the code

b)

To focus on the high-level overview without worrying about the details

c)

To make the program run faster

d)

To reduce the number of lines of code

26.

What is pattern recognition in the context of computational thinking?

a)

Recognizing and using patterns in code to make it more efficient

b)

Decomposing problems to notice common features and solve them

c)

Creating visual patterns for user interfaces

d)

Memorizing code patterns to avoid learning new programming languages

27.

What is generalisation in the context of computational thinking and problem solving?

a)

Writing code for a specific problem without considering future problems

b)

Solving a problem by using a solution that applies to only one specific case

c)

Creating a solution that solves a specific problem and cannot be applied to similar problems

d)

Solving new, unseen problems based on your understanding of previous problems you have solved

28.

What can pattern recognition in computational thinking help you to identify?

a)

The differences between various problems that have no similarities

b)

The parts, features, and requirements that a new problem has in common with an old problem

c)

The unique aspects of a problem that have never been encountered before

d)

The reasons why a problem cannot be solved using computational thinking

29.

Here is an error message: IndexError: list index out of range. Identify what type of error it is from the following options.

a)

Runtime error

b)

Syntax error

c)

User error

d)

Logic error

30.

Give three features found in an Integrated Development Environment (IDE).

a)

Editor, syntax checker, and debugger

b)

Compiler, command prompt, and antivirus

c)

Web browser, email client, and media player

d)

Spreadsheet, presentation software, and word processor