7.1 Programming Fundamentals Flashcards
What is a data type
Values than be used in a data item
Give some data types
Integer, float/real, character, string, Boolean
Integer
Whole numebers
Typical amount of memory for integer
2 bytes
Float/real
Number with a fraction part (1.3, 20.0)
Typical amount of memory for float/real
4 bytes
Char
A single ASCII char such as A, b, !, 3 and Space
Typical amount of memory for a char
1 byte
String
0 or more chars
Typical amount of memory for string
1 byte per char in string
Boolean
True or False
Typical amount of memory for a boolean
Theoretically 1 bit, but in high level languages often 1 byte
Difference between variables and constants
Variables can be changed while running and constants can only be changed before the program is run.
Input Statement
A way to gather inputted information from the user via the CLI (Command Line Interface)
Give some arithmetic operators
+, -, *, /, DIV, MOD