Data Types (1.4.1) Flashcards

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

What are the five main data types?

A
  • Character
  • String
  • Boolean
  • Integer
  • Real
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is an integer?

A

A whole number with no fractional part.

e.g. 6, -12, 451 , 0

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

What is a real number/float?

A

Numbers which can have a fractional part.

e.g. 0, -71.5, 5.01

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

What is a character?

A

A single letter, digit, symbol or control code

e.g. R, g, 7, &

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

What is a string?

A

A collection of characters.

e.g. “Hello world!”, “07789”

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

What is a boolean data type?

A

Can take one of two values (TRUE or FALSE)

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

How are data types represented in the computer?

A

Using binary (0s and 1s)

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

What is binary?

A

A number system in base 2 where each step represents a value of 2x the previous place

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

What is a bit?

A

A single binary digit

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

What is a byte?

A

Eight bits

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

What is a nybble?

A

Half a byte of four bits

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

Binary addition:

0+0+0=

A

0

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

Binary addition:

0+0+1=

A

1

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

Binary addition:

0+1+1=

A

10

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

Binary addition:

1+1+1=

A

11

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

Conjunction (AND)

A

gate: =|}-
symbol: ^
needs both inputs to be 1

17
Q

Disjunction (OR)

A

gate: =)}-
symbol: v
needs one or both inputs to be 1

18
Q

Negation (NOT)

A

gate:=|>.-
symbol: ¬
reverses the input i.e. 0 to 1, 1 to 0

19
Q

Exclusive Disjunction (XOR)

A

gate: =))}-
symbol: ⊻
needs one input to be true only, not when both are