Programming And Algorithms Flashcards
three reasons why programmers use functions
- to make code easier to read
- to allow for code sharing
- to reduce chances of programmer errors
what kind of data type is an integer
stores positive and negative whole numbers
what kind of data type is a real
stores numbers that contain decimal places
what kind of data type is a character
stores a single character that can be a letter, number or symbol
what kind of data type is a string
stores alphanumeric combinations and text
what kind of data type is a boolean
stores true or false only
what kind of data type is a float
high fractional precision values (rational numbers)
what is an array
a memory location that can store a value. the values is a variable that can change , but it can only hold one item of data
what must all data in an array be
the same, identical data type
what is a syntax error
an error in the syntax of a sequence of characters, breaking the rules of the language
what is a runtime error and why are they hard to detect
an error that crashes the program. they are hard to detect because nothing can appear to be wrong with the program, like lack of memory (you wont be told youre out of memory)
how much memory do integer data types take up
2 to 4 bytes
how much memory do real or float data types take up
4 to 8 bytes
how much memory do boolean data types take up
1 bit is needed but 1 byte is actually used
how much memory does a character data type take up
1 byte
how much memory does a string take up
1 byte for every character in the string
what are logical errors
when the program works but it produces a different result from what you designed or expected