fundamentals of programming Flashcards
what is a data type?
Basic ways data is stored on a program
what are the 8 data types?
Integer: A whole number. Eg 25,-3
Real/float : A number with a fractional part. Eg -13.5, 2.54
Boolean: A variable that can only take the value TRUE or FALSE
Character: A letter, number or special character (typically represented in ascii). Eg a, b, A, 4(integer), 4(real number)
String: Any set of characters in quotation marks. Eg “peter”, “132”
Date/time: used to store values holding the date and time
Record: Basic data column structure
Array/list: A structured data type that stores multiple pieces of information by assigning them a number starting from 0
what is a User defined data type?
A variable that is defined by the user manually and not in the program
what is a recursive subroutine
one which is defined in terms of itself. This means that somewhere within the recursive subroutine, there is a call to the subroutine itself.
what 3 characteristics must a recursive algorithm have
- a stopping condition/base case which will stop the routine calling itself when met
- input values apart from the stopping conditions
- the stopping condition must be met after a finite number of calls