1.4.1 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 07777777333?

A

String

  • Numeric types would remove the leading 0
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Perform an AND mask on the Binary numbers

10101101
01011011

A

00001001

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
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
4
Q

Add the two binary numbers and give answer in decimal

01011011
00111010

A

10010101

=

149

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

What is the decimal 45 in binary?

Give your answer as a byte

A

00101101

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

What is the hexadecimal 2E in decimal?

A

(2x16) + (14x1) = 46

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

What is the hexadecimal 45 in binary?

Give your answer as a byte

A

01000101

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
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
9
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
10
Q

What does the binary 01101100 represent in hex?

A

6C

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

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

A

The value is doubled (x2^1)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
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
13
Q

The binary 0011010000110 is a floating point number with a single-bit sign, 8 but 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
14
Q

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

A

26.5

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

Perform an XOR mask on the binary numbers:

01010101
10111011

A

11101110

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

Which of the following is not a character?

A: 8
B: R
C: %
D: 43

A

D

17
Q

The binary 1100110000011 is a floating point number with a single-bit sign, 8-bit mantissa and 4 but exponent

What is the number in decimal?

A

-9.5