Unit 7: Programming Flashcards

1
Q

What are the 5 data types needed for programming languages?

A

Integer, Real/Float, Boolean, Character, String

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

What is the code, characteristics and examples of an Integer?

A

Code: int
Characteristics: Whole number only
Examples: 0, 6, 102, -984

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

What is the code, characteristics and examples of a Real/Float?

A

Code: real
Characteristics: Numbers that have a decimal
Examples: -0.15, 100.0

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

What is the code, characteristics and examples of a Boolean?

A

Code: bool
Characteristics: Can only take one of two values (usually true/false)
Examples: True/False, Yes/No, 1/0

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

What is the code, characteristics and examples of a character?

A

Code: char
Characteristics: A single letter, number or symbol
Examples: A, k, 5, &

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

What is the code, characteristics and examples of an String?

A

Code: string
Characteristics: Used to represent text, it is a collection of characters
Examples: “Fs5tQR$”, “hi9)27S”

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

How much memory does each Data Type require?

A

Integer: 2 bytes or 4 bytes
Real: 4 bytes or 8 bytes
Boolean: 1 bit is needed but a byte is usually used
Character: 1 byte
String: 1 byte for every character in the string

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

ARRAYS

A

Info on CGP Page 94/95

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