wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

AS Data Types and Programming Constructs

Total questions: 22

Worksheet time: 11mins

Name
Class
Date
1.

Which data type is most suitable for storing True/False?

a)

Integer

b)

Real

c)

Float

d)

Boolean

2.

Which data type is most suitable for storing whole numbers?

a)

Integer

b)

Real

c)

Boolean

d)

Char

3.

Match this definition to the correct type: A number with a fractional part

a)

Real

b)

Integer

c)

Irrational

d)

Natural

4.

What would you store using the Char data type?

a)

A cartoon character such as Daffy Duck

b)

A string such as PIG

c)

An integer such as 17

d)

A single character such as T

5.

Choose all that could be stored as a string

a)

PIG

b)

p!g

c)

123.4

d)

False

6.

In VB.net a structure is needed to...

a)

Declare the names and types of data for records

b)

Enclose a loop or selection

c)

Create a new sub-routine

d)

Declare an array

7.

Pigs = {"porky", "scratchy", "grunter"}

Choose all that are true...

a)

Pigs(1) = "scratchy"

b)

Pigs.length = 3

c)

Pigs(Pigs.length - 1) = "grunter"

d)

Pigs(0) gives "Error: Out of bounds"

8.

Choose all that are iteration

a)

For z = 1 to Pigs.length - 1

Print(Pig(z))

Next

b)

Do While Pigs(z) <> "grunter"

Print(Pig(z))

z += 1

Loop

c)

If Pigs(z) = "scratcher"

Print("found")

End If

d)

Pigs(z + 1) = console.readline()

9.

Which one is simple selection

a)

For z = 1 to Pigs.length - 1

Print(Pig(z))

Next

b)

Do While Pigs(z) <> "grunter"

Print(Pig(z))

z += 1

Loop

c)

If Pigs(z) = "scratcher"

Print("found")

End If

d)

Pigs(z + 1) = console.readline()

10.

Choose all that involve any form of assignment

a)

Print(Pig(z))

b)

Do While Pigs(z) <> "grunter"

Print(Pig(z))

z += 1

Loop

c)

If Pigs(z) = "scratcher"

Print("found")

End If

d)

Pigs(z + 1) = console.readline()

11.

Choose all that are true about variables

a)

They must have a type

b)

They must have an identifier

c)

They cannot be changed during runtime

d)

They occupy a fixed amount of memory

12.

Choose all that are true about constants

a)

They must have a type

b)

They must have an identifier

c)

They cannot be changed during runtime

d)

They occupy a fixed amount of memory

13.

Choose all that are true about sub-routines

a)

Functions have parameters, procedures don't

b)

VB procedures are called Subs

c)

Functions return values, procedures don't

d)

Functions use local variables, procedures don't

14.

Choose the example of indefinite iteration

a)

For z = 1 to Pigs.length - 1

Print(Pig(z))

Next

b)

Do While Pigs(z) <> "grunter"

Print(Pig(z))

z += 1

Loop

c)

If Pigs(z) = "scratcher"

Print("found")

End If

d)

Pigs(z + 1) = console.readline()

15.

Choose the example of definite iteration

a)

For z = 1 to Pigs.length - 1

Print(Pig(z))

Next

b)

Do While Pigs(z) <> "grunter"

Print(Pig(z))

z += 1

Loop

c)

If Pigs(z) = "scratcher"

Print("found")

End If

d)

Pigs(z + 1) = console.readline()

16.

Why is the title image for this quiz a Jigglypuff?

a)

In Pokemon Go it is the only pokemon to have variable type

b)

VB.net has inbuilt Pokémon types

c)

Jigglypuff is represented as a Boolean

d)

It's really hard to get an image to show 'Data Types and Programming Structures'

17.

Why might a programmer put the condition at the end of an indefinite iteration structure?

a)

Because they forgot to do it at the top and it makes no difference.

b)

It makes the code easier to read

c)

To make sure the loop runs at least once

d)

Trick question: you can't actually do this

18.
a)

At the end x = 15

b)

At the end x = 30

c)

At the end x = 60

d)

At the end x = -20

19.

What is the identifier in Dim User as String = "Bob123"

a)

Dim

b)

User

c)

String

d)

"Bob123"

20.

What is the data type in Dim User as String = "Bob123"

a)

Dim

b)

User

c)

String

d)

"Bob123"

21.

What is the value in Dim User as String = "Bob123"

a)

Dim

b)

User

c)

String

d)

"Bob123"

22.

Dim User as String = "Bob123"

a)

Is just a declaration

b)

Is just an assignment

c)

Is a declaration and an assignment

d)

Is a selection