Back to marketplace

2.2.1 Programming Techniques

No description yet. This curated deck is ready for daily study.

Total cards: 18•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (18)

#1
Front (Question)

What is a variable?

Back (Answer)

• Identifier of a memory location used to store data • Used to store a value which can change during execution

#2
Front (Question)

What are global variables?

Back (Answer)

• The variable can be accessed throughout the scope of the program (visible throughout a program) • Using passing by reference is an equivalent of a global variable.

#3
Front (Question)

What are the negatives of global variables?

Back (Answer)

• Uses more memory - memory is declared when the program starts and remains in use throughout. • Testing more difficult - it is difficult to test an individual block of code. • Reduces data accuracy - Changing a global variable may have an impact on another module.

#4
Front (Question)

What are the positives of global variables?

Back (Answer)

• Simpler to program - values do not need to be passed between different subroutines. • Do not need to worry about returning values - all parts of the program can access the value.

#5
Front (Question)

What is a local variable?

Back (Answer)

Can only be accessed within the scope of the sub-program where it is created A parameter that is passed into a subroutine becomes a local variable in the subroutine e.g. LoadLevel(Difficulty)

#6
Front (Question)

What is an IDE?

Back (Answer)

Integrated Development Environment (IDE) - A program used for developing programs, made from several components.

#7
Front (Question)

Describe and explain the tools that are provided by an IDE to develop software

Back (Answer)

• Auto-complete – Will predict variable and built-in functions and finish off the word. Can avoid spelling mistakes and speed up development • Syntax highlighting (colour coding text) - Can distinguish between different features quickly to check code is correct • Auto Indent – Indents code automatically within structures to avoid errors

#8
Front (Question)

Describe and explain the tools that are provided by an IDE to debug software?

Back (Answer)

• Error highlighting - Syntax errors highlight dynamically so they can be corrected before running the program (saving time) • Variable Watch window – Display the values of the variables during running of the program • Break points- Stop the program at set points to check the values of variables. Developer can add multiple breakpoints. • Error message list- Tells you where errors are and suggests corrections • Stepping - Executes program one line at a time to watch variable values and program pathways • Traces - Printouts of variable values for each statement execution

#9
Front (Question)

What are the three programming constructs?

Back (Answer)

Sequence Selection / Branching Iteration

#10
Front (Question)

What is an example of a count controlled loop?

Back (Answer)

FOR Loop - Will run for a set number of predetermined times.

#11
Front (Question)

What is an example of a condition controlled loop?

Back (Answer)

WHILE / DO WHILE - Will run whilst a condition is true or false

#12
Front (Question)

What is the difference between a WHILE loop and a DO loop?

Back (Answer)

• While loop will check the condition at the start of the loop - this means the code may never run • Do loop will check the condition at the end of the loop - this means the code will always run at least once

#13
Front (Question)

What are parameters?

Back (Answer)

Parameters are the variables listed between the brackets, after the procedure/function name. They become local variables in the routines that they are passed to. characterMovement(inputKey, characterx, charactery)

#14
Front (Question)

What does passing by value mean?

Back (Answer)

By Value (ByVal) * Does not override the original data * A local copy of the data is used * Data is discarded when the subprogram exits

#15
Front (Question)

What does passing by reference mean?

Back (Answer)

By Reference (ByRef) * Changes are made to the original data * Memory location of data is sent * Changes remain after the subprogram exits * Uses less memory

#16
Front (Question)

What is a function?

Back (Answer)

• A named block of code which always returns a value • Uses the keyword return • Assigns the returned value to a variable (e.g. y)

Card back image
#17
Front (Question)

What is a procedure?

Back (Answer)

• A named block of code which does not return a value • Does not use the keyword return • Is called by writing its name but not assigning the result to a variable

Card back image
#18
Front (Question)

What is modularity and what are the benefits of using it when writing code?

Back (Answer)

Breaking code down into functions / procedures / scripts • Write once and call repeated times - Avoids repeated code. • Can be tested individually and then added to the main program. • Can be reused in other programs - No need to reprogram so saves time • Can give sub-routines to different programmers to build concurrently • Breaks problems into smaller areas. Small sub-programs are easier to read / understand / modify