WorksheetsAS Data Types and Programming Constructs
Total questions: 22
Worksheet time: 11mins
Which data type is most suitable for storing True/False?
Integer
Real
Float
Boolean
Which data type is most suitable for storing whole numbers?
Integer
Real
Boolean
Char
Match this definition to the correct type: A number with a fractional part
Real
Integer
Irrational
Natural
What would you store using the Char data type?
A cartoon character such as Daffy Duck
A string such as PIG
An integer such as 17
A single character such as T
Choose all that could be stored as a string
PIG
p!g
123.4
False
In VB.net a structure is needed to...
Declare the names and types of data for records
Enclose a loop or selection
Create a new sub-routine
Declare an array
Pigs = {"porky", "scratchy", "grunter"}
Choose all that are true...
Pigs(1) = "scratchy"
Pigs.length = 3
Pigs(Pigs.length - 1) = "grunter"
Pigs(0) gives "Error: Out of bounds"
Choose all that are iteration
For z = 1 to Pigs.length - 1
Print(Pig(z))
Next
Do While Pigs(z) <> "grunter"
Print(Pig(z))
z += 1
Loop
If Pigs(z) = "scratcher"
Print("found")
End If
Pigs(z + 1) = console.readline()
Which one is simple selection
For z = 1 to Pigs.length - 1
Print(Pig(z))
Next
Do While Pigs(z) <> "grunter"
Print(Pig(z))
z += 1
Loop
If Pigs(z) = "scratcher"
Print("found")
End If
Pigs(z + 1) = console.readline()
Choose all that involve any form of assignment
Print(Pig(z))
Do While Pigs(z) <> "grunter"
Print(Pig(z))
z += 1
Loop
If Pigs(z) = "scratcher"
Print("found")
End If
Pigs(z + 1) = console.readline()
Choose all that are true about variables
They must have a type
They must have an identifier
They cannot be changed during runtime
They occupy a fixed amount of memory
Choose all that are true about constants
They must have a type
They must have an identifier
They cannot be changed during runtime
They occupy a fixed amount of memory
Choose all that are true about sub-routines
Functions have parameters, procedures don't
VB procedures are called Subs
Functions return values, procedures don't
Functions use local variables, procedures don't
Choose the example of indefinite iteration
For z = 1 to Pigs.length - 1
Print(Pig(z))
Next
Do While Pigs(z) <> "grunter"
Print(Pig(z))
z += 1
Loop
If Pigs(z) = "scratcher"
Print("found")
End If
Pigs(z + 1) = console.readline()
Choose the example of definite iteration
For z = 1 to Pigs.length - 1
Print(Pig(z))
Next
Do While Pigs(z) <> "grunter"
Print(Pig(z))
z += 1
Loop
If Pigs(z) = "scratcher"
Print("found")
End If
Pigs(z + 1) = console.readline()
Why is the title image for this quiz a Jigglypuff?
In Pokemon Go it is the only pokemon to have variable type
VB.net has inbuilt Pokémon types
Jigglypuff is represented as a Boolean
It's really hard to get an image to show 'Data Types and Programming Structures'
Why might a programmer put the condition at the end of an indefinite iteration structure?
Because they forgot to do it at the top and it makes no difference.
It makes the code easier to read
To make sure the loop runs at least once
Trick question: you can't actually do this
At the end x = 15
At the end x = 30
At the end x = 60
At the end x = -20
What is the identifier in Dim User as String = "Bob123"
Dim
User
String
"Bob123"
What is the data type in Dim User as String = "Bob123"
Dim
User
String
"Bob123"
What is the value in Dim User as String = "Bob123"
Dim
User
String
"Bob123"
Dim User as String = "Bob123"
Is just a declaration
Is just an assignment
Is a declaration and an assignment
Is a selection
