programming fundamentals Flashcards
sequence
structuring code into a logical, sequential order
selection
decision making using if statements
iteration
repeating code using for or while loops
what do the three constructs of programming do
control the flow of a program
variable
- a location in the memory that is used to store data in programs
- they can be changed as the program runs
what are the two parts of the variable
data value and identifier
local variables
variables that are declared within a specific subroutine and can only be used within that subroutine
global variables
can be used at any point within the whole program
local variable advantages
- saves memory (only uses memory when needed)
- easier to debug (as can only be changed within the subroutine)
- can reuse subroutine with lv in other programs
global variable advantages
- can be used anywhere
- makes maintenance easier as they are only declared once
- can be used for constants
constants
a location in the memory that stores data and does not change value as the program is run e.g pi
>
greater than
<
less than
> =
greater than or equal to
<=
less than or equal to