Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

GCSE Computer Science Data types

Total questions: 18

Worksheet time: 9mins

Name
Class
Date
1.

Which data type is used for whole numbers

a)

sting

b)

real

c)

floating point

d)

integer

2.

Which data type is used for text

a)

integer

b)

String

c)

Mod

d)

real

3.

Which data type is used for a decimal number

a)

decimal

b)

real

c)

floating point

d)

integer

4.

Which data type would be best to record the gender of a pupil

a)

character

b)

integer

c)

string

d)

real

5.

Which of these would not be considered the character data type?

a)

M

b)

F

c)

MAN

d)

G

6.

Individual letters can be taken from a string. Which of the following would output the length of the string Borland

a)

OUTPUT LENGTH(Borland)

b)

OUTPUT LEN(Borland)

c)

OUTPUT LEN(TEACHER)

d)

OUTPUT LENGTH(TEACHER)

7.

What would the output be from the code Len(Chelsea)

a)

5

b)

6

c)

7

d)

8

8.

The number 9 is stored in a program as a string. Why is this the wrong data type for the number 9?

a)

Numbers should simply be always stored as strings

b)

the programmer might think 9 is the letter "p"

c)

Calculations can only be done with integers not strings.

d)

It isnt really a problem

9.

To convert a piece of data stored in a string into a whole number you should use the code....

a)

STRING_TO_INT

b)

INT_TO_STRING

c)

STRING_TO_REAL

d)

STRING_TO_FLOAT

10.

To convert a piece of data stored in a string into a decimal number you should use...

a)

STRING_TO_INT

b)

INT_TO_STRING

c)

STRING_TO_REAL

d)

STRING_TO_FLOAT

11.

To convert a whole number into a string you should use...

a)

INT_TO_STRING

b)

INT_TO_TEXT

c)

INT_TO_LETTERS

d)

REAL_TO_STRING

12.

Which data type is also used by a logic gate?

a)

BOOLEAN

b)

STRING

c)

INTEGER

d)

REAL

13.

Variables with the boolean data type have two possible states. Which are they?

a)

TRUE

b)

ON

c)

FALSE

d)

OFF

14.

You can use the code SUBSTRING() to output a single letter from a whole string. With the input "Computer", what would the output from the code SUBSTRING(2, Computer). Indexing starts at 0.

a)

m

b)

o

c)

p

d)

u

15.

You can use the code SUBSTRING() to output a single letter from a whole string. With the input "Computer", what would the output from the code SUBSTRING(2, 5, Computer). Indexing starts at 0.

a)

m, e

b)

o, t

c)

m, t

d)

o, e

16.

You can use the code SUBSTRING() to output a single letter from a whole string. With the input "Computer". Which of the following SUBSTRING codes would produce an output which would also be a real word.

a)

SUBSTRING(0, 4, 5, Computer)

b)

SUBSTRING(5, 6, 7, 2, Computer)

c)

SUBSTRING(2, 4, 5, 6, Computer)

d)

SUBSTRING(7, 6, 0, 5, 4, 2, Computer)

17.

CHAR_TO_CODE can be used to convert a letter into its ASCII number. CHAR_TO_CODE(A) would OUTPUT "66". What would CHAR_TO_CODE(B) output?

a)

70

b)

65

c)

67

d)

68

18.

CODE_TO_CHAR can be used to convert a number into its matching letter in the ascii tabler. CODE_TO_CHAR(70) would OUTPUT "E". What would CHAR_TO_CODE(73, 68,68) output?

a)

HOOT

b)

GOO

c)

HCC

d)

EAL