data type
data that we use and store in computer programs that come in various shapes and sizes
data types
-integer
-real/double
-boolean
-character
-string
-records
-arrays
-date/time
-pointer/reference
primitive data type
-supported by all languages
-any basic data type provided by a language as a foundational building block
composite data type
built by combining other data types
integer:
-any positive or negative whole number
real/double
-decimal / fractional numbers
boolean
-value which is either true or false
pointer/reference
a way of storing memory address
string
-sequence of characters
character
-single number or letter
user defined data type
derived from existing data types in order to create a customised data structure,, ensures it is memory efficient
programming concepts:
-variable declaration
-constant declaration
-assignment
-iteration
-selection
-subroutine
variable declaration:
-creating a variable type and giving it a name or sometimes a data type
constant declaration:
-same as variable declaration but when creating the constant the value of it doesn’t change while the program is running
assignment:
-giving a constant or variable a value
iteration:
-repeating a instruction can be definite or indefinite
selection:
-comparing values and choosing a action based on the values
subroutine:
-block of code containing a set of instructions that can be called from other parts of the program
definite iteration:
-loop repeats for a specific number of times
indefinite iteration:
-block of code only repeats as long as the condition is true
nesting:
-when one structure is placed within another to create a more complex structure
arithmetic operations:
-addition
-subtraction
-multiplication - *
-division - /
relational operations:
-used to compare 2 values
-equal to - ‘=’
-not equal to - ‘!’
-less than - ‘<’
-greater than - ‘>’
-less than or equal to - ‘<=’
-greater than or equal to - ‘>=’
boolean operations:
-NOT ,, ! , opposite of a boolean value
-AND ,, && , product of 2 boolean values
-OR ,, ||, sum of 2 boolean values
-XOR - true if only one of 2 values is true