Font size
WorksheetsVery Basic Programming
Total questions: 20
Worksheet time: 11mins
In VB.NET, which of these is a way to declare a variable?
Dim name as String
Make name a String
name = String
String(name)
In VB.NET this is an example of a definite iteration:
For i = 0 to 9 .... Next
While count <= 10 ... Loop
If x = 10 then ... Else ... End If
name = "Bob"
In VB.NET this is an example of an indefinite iteration:
For i = 0 to 9 .... Next
While count <= 10 ... Loop
If x = 10 then ... Else ... End If
name = "Bob"
In VB.NET this is an example of a selection statement
For i = 0 to 9 .... Next
While count <= 10 ... Loop
If x = 10 then ... Else ... End If
name = "Bob"
In VB.NET a Structure can be created to store related data together. What is this a type of?
Record
Array
List
Dictionary
What is used to store values within a fixed length data structure?
Array
List
Structure
File
Procedures and functions are types of what?
Subroutines
Files
Arrays
Variables
Which data type would be used to store someone's name?
String
Integer
Boolean
Single
Which data type would be used to store someone's age?
String
Integer
Boolean
Single
Which data type would be used to store a True or False value?
String
Integer
Boolean
Single
In VB.NET this is an example of a procedure:
Sub importFile(ByVal nameOfFile as String)
What is nameOfFile an example of?
Parameter
Integer
Module
Function
In VB.NET, how is an array of string types declared?
Dim names(9) As String
Dim Array of String(9)
Dim StringArray(names)
Dim String(name) of 9
What is MOD used for?
To find the remainder in a division
To find the in the integer part of a division
To find that value following the decimal point in a division
To find the result of a multiplication
What is DIV used for?
To find the remainder in a division
To find the in the integer part of a division
To find that value following the decimal point in a division
To find the result of a multiplication
Correct use of concatenation in VB.NET...
Writeline("Hello " & name)
Writeline("Hello " and name)
Writeline("Hello ") & name
Writeline("Hello " && name)
In VB.NET (and C#) what is the effect of passing a parameter using ByVal?
If the value passed into the parameter is changed, it is only for that subroutine, while it is running.
If the value passed into the parameter is changed, it is changed in memory.
In VB.NET (and C#) what is the effect of passing a parameter using ByRef?
If the value passed into the parameter is changed, it is only for that subroutine, while it is running.
If the value passed into the parameter is changed, it is changed in memory.
Which of these can be used to make code more readable?
Comments
Indentation
Sensible names for variables and subroutines
Changing the font to Wingdings
Why do we use subroutines?
Allows sections of code to be used multiple times
As a modular approach, it is easier to modify sections of code
To make programming more complicated
To ensure that other programmers can't change the code
What is the main difference between a function and a procedure?
Functions return a value
Procedures return a value
Functions use parameters
Procedures use parameters
