Data Types Flashcards
What data type should be used for storing a phone number like 07886756443?
String
Why should numeric types not be used for storing phone numbers?
Numeric types would omit the leading 0.
Perform an AND mask on the binary numbers 1010110101011011 and 00001001.
Result: 00001001.
Which data type stores a collection of characters?
String.
Add the two binary numbers 01011011 and 00111010. What is the answer in decimal?
Result: 114.
What is the decimal 45 in binary? Give your answer as a byte.
101101
What is the hexadecimal 2E in decimal?
Result: 46.
What is the hexadecimal 45 in binary? Give your answer as a byte.
1000101
Which data type stores just True and False?
Boolean.
What is -5 in sign magnitude binary? Give your answer as a nybble.
1101
What does the binary 01101100 represent in hexadecimal?
6C.
What is the effect of a logical shift left by one place?
The value is doubled.
What is the two’s complement binary 10101101 in decimal?
-83
The binary 0011010000110 is a floating point number with a single-bit sign 8-bit mantissa and 4-bit exponent. What is the number in decimal?
52
Perform a logical shift right by two places on the binary number 01101010 and convert your result to decimal.
Result: 26.