2.2.1 Programming Techniques Flashcards

1
Q

What is a procedural programming language?

A

High level language
Given a series of instructions in a logical order

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Explain parameter passing? [5 marks]

A

Parameters passed by value or by reference
By value, local copy of data is used then discarded… so value of original data is unchanged
By reference, location of data is used….so changes may be made to value of data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Describe the use of local variables

A

Defined within one module…accessible only in that module
Can be used as parameters
Data is lost at the end of the module
Same variable name can be used in other modules without overwriting
Can overwrite global variables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are 3 differences between global and local variables?

A

Global are defined at the start of a program
Exist throughout program
Allows data to be shared by modules

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a variable?

A

Identifier of a memory location used to store data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is meant by scope in relation to global and local variables?

A

Range of procedure/function that variable is valid for
A local variable takes precedence over a global variable with the same identifier to be used for different purposes without conflict

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the advantages of writing an application in a modular approach? [6 marks]

A

Work is easier to divide between a team
Each team member just needs to know what values go into their sub routine
Saves time as work takes place in parralel
Each team member can work on their area of expertise
Breaks problems into smaller areas
Easier to test and debug
Each subroutine can be tested before integration
Code can be reused in future projects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are 6 features of IDEs?

A

Auto complete
Colour coding text
Stepping
Breakpoints
Variable watch
Error diagnostics

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does auto complete allow programmers to do?

A

Can view identifiers and avoid spelling mistakes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What was colour coding text allow programmers to do?

A

Can identify features quickly to check if code is correct

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does stepping allow programmers to do?

A

Run one line of code at a time and check results

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does breakpoints allow programmers to do?

A

Stop the code at a set point to check value of variables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does variable watch allow programmers to do?

A

Check values of variables and how they change during the execution

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What do error diagnostics allow programmers to do?

A

Locate and report errors and give details on errors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly