Recognizing Data Types Flashcards
[ Identification ]
It describes a specific data that can be stored in a variable.
Defines how the data of a variable will be used by the program.
Data Type
[ Name the data type being described. ]
Holds and displays unit of information equivalent to one alphabetic letter or symbol.
Examples:
‘J’, ‘R’, ‘U’
‘N’, ‘C’, ‘R’
CHARACTER (char)
[ Name the data type being described. ]
It refers to a collection or series of characters which represents name of an entity.
Examples:
“JRU”
“ICTS112”
STRING
[ Name the data type being described. ]
Has a value of real number or whole number.
Examples:
101, 90, 1919
75, 60, 120
INTEGER (int)
[ Name the data type being described. ]
Recognizes decimals or fractions of numbers.
Examples:
0.95, 70.00, .05
10.5, 1.75, 90.6
FLOAT
[ Name the data type being described. ]
It contains values with two options.
Example:
TRUE or FALSE
Boolean
[ Identification ]
A type of declaration for floating numbers which stores 4-byte decimal spaces (32 bits or 2^32).
SINGLE
[ Identification ]
A type of declaration for floating numbers which stores 8-byte decimal spaces (64 bits or 2^64).
It can hold even the smallest and largest approximation of a real number.
DOUBLE
[ Identification ]
An integer which can hold a 4-byte place value (32 bits or 2^32 place value)
Range:
-32,768 - 32,768
SHORT
[ Identification ]
An integer which can hold an 8-byte place value (64 bits or 2^64 place value)
Range:
-2^63 - 2^63
LONG
[ What are these? ]
- The name must begin with a letter.
- The name must contain only letters, numbers, and the underscore characters.
- The name cannot contain more than 255 characters.
- The name cannot be a reserved word.
Rules for Naming a Variable
______ words are English words used as codes in C++ programming
Examples: main, else, float, if, string
Reserved words
[ What are these? ]
int grade;
int quiz1, quiz2, quiz3;
string username;
float average;
Examples of Declaring a Variable