8.11 Data Types and Arithmetic Operators Flashcards

1
Q

Declaring a Variable - Pseudocode
What datatype is needed for the following variables?

age
name
height
grade
isHungry

A

INTEGER age
STRING name
REAL height
CHAR grade
BOOLEAN isHungry

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

Datatypes you need to know
Define these datatypes:

INTEGER
STRING
REAL
CHAR
BOOLEAN

A

INTEGER - Stores a whole number, such as 3, 45,‐453

STRING - Stores zero or more sequence of characters. Most programming languages have a limit of 255 characters

REAL – Stores integers and numbers with a decimal part e.g. 3 , 3.2, -9.11

CHAR – Stores a single character (can be any letter, digit, punctuation mark or symbol that can be typed)

Boolean - Stores only 2 possible values, either true (1) or false (0)

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