The use of data types and casting Flashcards

1
Q

What does each data type use?

A
  • different amount of memory.
  • ## To optimise program the correct data type should be used.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a integer?

A
  • Whole number.
  • Positive or Negative.
  • Use for data that requires calculations.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a real (float)?

A
  • Number with a decimal part.

- Use for data that requires calculations.

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

What is a character?

A
  • Single Alphanumeric character.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is string?

A
  • Set of characters.

- not used for calculations.

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

What is Boolean?

A
  • True or False.

- Track if something has happened or not.

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

What is casting?

A
  • Converting an variable from one data type to another.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the advantages of casting?

A
  • Sub-Problems receive data in format expected.
  • Allows numbers to be manipulated into strings
  • ## Inputs that are always strings to become numbers.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly