Section 5 - Programming Flashcards

1
Q

What is integer in pseudocode?

A

Int

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

What does an integer mean?

A

Whole numbers only

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

What is real (or float) in pseudocode?

A

real

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

What does real (or float) mean?

A

Numbers that have a decimal part

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

What is boolean in pseudocode?

A

bool

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

What does boolean mean?

A

Can only take one of two values, usually TRUE or FALSE

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

What is character in pseudocode?

A

char

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

What does character mean?

A

A single letter, number, symbol

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

What is string in pseudocode?

A

string

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

What does string mean?

A

Used to represent text, it is a collection of characters

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

What are the different data types?

A

Integer, real, boolean, character, string

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

How much memory is an integer usually allocated?

A

2 bytes or 4 bytes

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

How much memory is real usually allocated?

A

4 bytes or 8 bytes

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

How much memory is boolean usually allocated?

A

1 bit is needed but usually 1 byte is used

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

How much memory is a character usually allocated?

A

1 byte

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

How much memory is a string usually allocated?

A

1 byte for every character in the string

17
Q

Why is it important to use the correct data types?

A

It makes code more memory efficient, robust and predictable

18
Q

What is casting?

A

Manually converting between data types by using functions

19
Q

Which commands can be used for casting?

A

int(), float(), bool(), str()