Data Types Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What data type should be used for storing a phone number like 07886756443?

A

String

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why should numeric types not be used for storing phone numbers?

A

Numeric types would omit the leading 0.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Perform an AND mask on the binary numbers 1010110101011011 and 00001001.

A

Result: 00001001.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which data type stores a collection of characters?

A

String.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Add the two binary numbers 01011011 and 00111010. What is the answer in decimal?

A

Result: 114.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the decimal 45 in binary? Give your answer as a byte.

A

101101

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the hexadecimal 2E in decimal?

A

Result: 46.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the hexadecimal 45 in binary? Give your answer as a byte.

A

1000101

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Which data type stores just True and False?

A

Boolean.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is -5 in sign magnitude binary? Give your answer as a nybble.

A

1101

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does the binary 01101100 represent in hexadecimal?

A

6C.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the effect of a logical shift left by one place?

A

The value is doubled.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the two’s complement binary 10101101 in decimal?

A

-83

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

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?

A

52

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Perform a logical shift right by two places on the binary number 01101010 and convert your result to decimal.

A

Result: 26.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Perform an XOR mask on the binary numbers 01010101 and 10111011.

A

Result: 11101110.

17
Q

Which of the following is not a character? A B C D

A

D.

18
Q

The binary 1100110000011 is a floating point number with a single-bit sign 8-bit mantissa and 4-bit exponent. What is the number in decimal?

A

-9.5.