2.2.1 Programming Techniques Flashcards Preview

A Level Computer Science > 2.2.1 Programming Techniques > Flashcards

Flashcards in 2.2.1 Programming Techniques Deck (11)
Loading flashcards...
1

What are the primary programming constructs?

Sequence

Iteration

Branching/Selection

2

What are examples of count-controlled and condition-controlled loops?

Count: For loop

Condition: While loop

3

Define 'recursion'

A function calling itself until a condition is met

4

What are the benefits and drawbacks of recursion?

Benefits:

Can be used to traverse trees

Drawbacks:

Requires more storage space than an iterative solution

A missing condition will lead to a stack overflow

5

Define 'global variable'

  • A variable accessible anywhere within a program
  • Allocated a distinct memory location during execution

6

Define 'local variable'

  • A variable only accessible within a specific part of a program
  • Usually defined within a function or passed by value

7

Define 'scope'

Refers to where a variable/constant can be accessed.

The scope is either local to a subroutine or global to a program

8

Explain 'passing by value'

A copy of the variable is created within the subroutine, therefore the original variable is unchanged without returning the value

9

Explain 'passing by reference'

A pointer to the variable is created when passed.

When changed within the subroutine, it is updated to the original as well

10

Define 'IDE'

Integrated Development Environment:

Provides tools and an area to create code

11

What are some common features of an IDE?

  • Warning alerts
  • Colour coding
  • Commenting
  • Auto-complete and hints
  • Translating and running code