登录

Records

Data types

  • Data types allow programming languages to provide different classifications for items of data, so they can be used for different purposes.

DECLARE <identifier> : <data type>
DECLARE number : INTEGER

Data type

Description

Pseudocode

Python

boolean

Logical values, True (1) and False (0)

BOOLEAN

bool

char

Single alphanumerical character

CHAR

Not used

date

Value to represent a date

DATE

class datetime

integer

Whole number, positive or negative

INTEGER

int

real

Positive or negative number with adecimal point

REAL

float

string

Sequence of alphanumericalcharacters

STRING

str

question

Data types
填空题
ID:196

Filling the data types for pseoducode.

1. Logical values, True (1) and False (0):

2. Single alphanumerical character:

3. Value to represent a date:

4. Whole number, positive or negative:

5. Positive or negative number with adecimal point:

6. Sequence of alphanumerical characters:

[0/6]

Records

  • Records are composite data types formed by the inclusion of several related items that may be of different data types.

TYPE
<Typename>
    DECLARE <identifier> : <data type>
    DECLARE <identifier> : <data type>
    DECLARE <identifier> : <data type>
    ……
ENDTYPE
TYPE
TbookRecord
    DECLARE title : STRING
    DECLARE author : STRING
    DECLARE publisher : STRING
    DECLARE noPages : INTEGER
    DECLARE fiction : BOOLEAN
ENDTYPE
DECLARE Book : TbookRecord
Book.author ← "David"
Book.fiction ← FALSE
Data types
填空题
ID:197

are composite data types formed by the inclusion of several related items that may be of different data types

[0/1]

登录