Programming Techniques Flashcards

1
Q

Variable

A

A named location in memory that holds data. The data can be changed while the program is running.

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

Constant

A

A named location in memory that holds data. The data can not be changed while the program is running.

Using constants make programs easier to maintain as humans find it easier to type words than numbers (eg pi instead of 3.14159265). These can be set once in the code and then used throughout.

If the value needs to be changed it only has to be changed where it is set and the new value will be used throughout.

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

Casting

A

Changing the data type of a variable. Eg changing an integer into a string so that it can be displayed within a message.

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

Concatenation

A

Joining strings together.

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

Selection

A

Some lines of code are run, and others not, depending on a condition.

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

Sequence

A

All lines of code are run in the order in which they are presented.

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

Iteration

A

Some (or all) lines of code are repeated either a set number of times or until a condition has been met.

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