WorksheetsImplementation - PowerPoint 1 Higher
Total questions: 14
Worksheet time: 7mins
What are variables used for in programming?
To identify storage locations in memory
To increase the processing speed of the CPU
To connect to the internet
To create graphical user interfaces
What type of variable can be accessed by any procedure/function in the program at any time?
Local variable
Constant variable
Static variable
Global variable
Where can a local variable be accessed?
Anywhere in the program
Only inside the procedure/function it is declared in
Only outside the procedure/function it is declared in
Inside any procedure/function regardless of where it is declared
Can a local variable be accessed by any other sub-program unless they are passed as a parameter or returned from a function?
Yes, always
No, never
Yes, but only if they are global
No, unless they are passed as a parameter or returned from a function
What is assignment in the context of programming?
The process of comparing two values
The process of assigning a value to a variable
The process of performing arithmetic operations
The process of printing a value to the screen
What do 1-D arrays allow programmers to do?
Store a single piece of data
Store multiple pieces of data of different data types
Store multiple pieces of data of the same data type
Execute complex algorithms
How would you declare an array to store 30 pupil scores using zero-based indexing?
Dim pupilScore(30) As Integer
Dim pupilScore(29) As Integer
Dim pupilScore(28) As Integer
Dim pupilScore(31) As Integer
How do you declare an empty array of strings in the given language?
DECLARE cities AS STRING INITIALLY [ ]
DECLARE cities AS STRING [ ]
DECLARE cities AS ARRAY [ ]
DECLARE cities AS STRING INITIALLY { }
What are parallel arrays?
Arrays that are used to sort information.
Arrays that are used in conjunction with each other to display information together.
Arrays that contain identical elements.
Arrays that are used to store information independently.
What are records in programming?
Predefined data types provided by the programming language
Programmer defined data types
Functions that return multiple values
A type of loop structure
How can you hold multiple data types inside an array?
By creating a multidimensional array
By defining an array with a generic type
By creating a record type, which then allows the creation of an array of records
By using a union data type
What is the correct syntax to declare a structure named petData in VB?
Structure petData { name As String, type As String, ownerName As String, tagID As Integer }
Structure petData Public name As String Public type As String Public ownerName As String Public tagID As Integer End Structure
Structure petData Public name As String Public type As String Public ownerName As String Public tagID As Integer End Structure
RECORD petData IS { STRING name, STRING type, STRING ownerName, INTEGER tagID }
In the Reference Language, how are the data types of the fields 'name', 'type', and 'ownerName' declared?
INTEGER
STRING
Structure
Public
How do you declare an array of records in VB for storing pet data?
Dim pets As petData[3]
Dim pets(3) As petData
Dim [3]pets As petData
Dim petData pets(3)
