1.4.1 Data Types Flashcards

(15 cards)

1
Q

What is a data type?

A

A classification of data into groups according to the kind of data they represent e.g., integer, real, char, string, and Boolean.

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

What is casting?

A

When you convert one data type into another data type.

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

How many bits does a byte represent?

A

8 bits.

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

What is binary?

A

A system of representing info using only two digits (0 and 1).

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

What is a bit?

A

The smallest unit of digital information, representing either an “off” (0) or an “on” (1) state.

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

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

A

String
Numeric types would omit the leading 0.

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

What data type should be used for storing a single character such as ‘a’, ‘$’, or ‘5’?

A

Char

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

Perform an AND mask on the binary numbers:
1101
1011

A

1001

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

What do the following binary numbers add to:
1. 0+0+0
2. 0+0+1
3. 0+1+1
4. 1+1+1

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

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

A

00010001

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

What does the most significant bit in sign and magnitude represent if it is 1 and if it is 0?

A

1 means negative number, 0 means positive number.

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

Translate the binary number 1000 1111 to denary using Sign and Magnitude

A

-15

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

Translate 24 to binary using sign and magnitude

A

0001 1000

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

What does the most significant bit in Two’s complement represent if it is 1 and if it is 0?

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