Programming fundamentals Flashcards

1
Q

What is a variable

A

A named address which holds a value, the value held can and most likely will change throughout the program

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

What is the variables name known as

A

An identifier

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

What is a constant

A

Allows a value to be assigned a name, unlike a variable it cannot be changed while the program is running

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

What are the 3 basic programming constructs

A
  1. Iteration
  2. Selection
  3. Sequencing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a sequencing

A

The order in which instructions occur and are processed

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

What is selection

A

Determines which path a program takes when it is running.
The process of making a decision

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

What is iteration

A

The repeated execution of a section of code while the program is running

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

What are the two types of iteration

A
  1. Count controlled iteration
  2. Condition controlled iteration
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a count controlled loop

A

A for loop, it will repeatedly execute a section of code for a fixed number of predetermined times

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

Advantages of a count controlled loop

A
  • The program is simplified
  • Fewer lines of code meaning less chance for errors
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a condition controlled loop

A

A while loop, it will repeatedly execute a section of code until a condition is met, or no longer met

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

What is an infinite loop

A

A condition controlled loop which is written to continue for forever
Can be done on purpose or by accident

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

What is nesting

A

When one programming construct is included within another

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

What are the mathematical operators

A

+ ‘addition’
- ‘subtraction’
* ‘multiplication
/ ‘division’
DIV ‘integer division’
MOD ‘remainder’

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

What are the comparison operators

A

< less than
> bigger than
= assignment
== equal too
<= less than or equal too
>= greater than or equal too
!= does not equal

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