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.
2
Q
What is a integer?
A
- Whole number.
- Positive or Negative.
- Use for data that requires calculations.
3
Q
What is a real (float)?
A
- Number with a decimal part.
- Use for data that requires calculations.
4
Q
What is a character?
A
- Single Alphanumeric character.
5
Q
What is string?
A
- Set of characters.
- not used for calculations.
6
Q
What is Boolean?
A
- True or False.
- Track if something has happened or not.
7
Q
What is casting?
A
- Converting an variable from one data type to another.
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.