Programming fundamentals Flashcards
What is a variable
A named address which holds a value, the value held can and most likely will change throughout the program
What is the variables name known as
An identifier
What is a constant
Allows a value to be assigned a name, unlike a variable it cannot be changed while the program is running
What are the 3 basic programming constructs
- Iteration
- Selection
- Sequencing
What is a sequencing
The order in which instructions occur and are processed
What is selection
Determines which path a program takes when it is running.
The process of making a decision
What is iteration
The repeated execution of a section of code while the program is running
What are the two types of iteration
- Count controlled iteration
- Condition controlled iteration
What is a count controlled loop
A for loop, it will repeatedly execute a section of code for a fixed number of predetermined times
Advantages of a count controlled loop
- The program is simplified
- Fewer lines of code meaning less chance for errors
What is a condition controlled loop
A while loop, it will repeatedly execute a section of code until a condition is met, or no longer met
What is an infinite loop
A condition controlled loop which is written to continue for forever
Can be done on purpose or by accident
What is nesting
When one programming construct is included within another
What are the mathematical operators
+ ‘addition’
- ‘subtraction’
* ‘multiplication
/ ‘division’
DIV ‘integer division’
MOD ‘remainder’
What are the comparison operators
< less than
> bigger than
= assignment
== equal too
<= less than or equal too
>= greater than or equal too
!= does not equal