wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Very Basic Programming

Total questions: 20

Worksheet time: 11mins

Name
Class
Date
1.

In VB.NET, which of these is a way to declare a variable?

a)

Dim name as String

b)

Make name a String

c)

name = String

d)

String(name)

2.

In VB.NET this is an example of a definite iteration:

a)

For i = 0 to 9 .... Next

b)

While count <= 10 ... Loop

c)

If x = 10 then ... Else ... End If

d)

name = "Bob"

3.

In VB.NET this is an example of an indefinite iteration:

a)

For i = 0 to 9 .... Next

b)

While count <= 10 ... Loop

c)

If x = 10 then ... Else ... End If

d)

name = "Bob"

4.

In VB.NET this is an example of a selection statement

a)

For i = 0 to 9 .... Next

b)

While count <= 10 ... Loop

c)

If x = 10 then ... Else ... End If

d)

name = "Bob"

5.

In VB.NET a Structure can be created to store related data together. What is this a type of?

a)

Record

b)

Array

c)

List

d)

Dictionary

6.

What is used to store values within a fixed length data structure?

a)

Array

b)

List

c)

Structure

d)

File

7.

Procedures and functions are types of what?

a)

Subroutines

b)

Files

c)

Arrays

d)

Variables

8.

Which data type would be used to store someone's name?

a)

String

b)

Integer

c)

Boolean

d)

Single

9.

Which data type would be used to store someone's age?

a)

String

b)

Integer

c)

Boolean

d)

Single

10.

Which data type would be used to store a True or False value?

a)

String

b)

Integer

c)

Boolean

d)

Single

11.

In VB.NET this is an example of a procedure:

Sub importFile(ByVal nameOfFile as String)

What is nameOfFile an example of?

a)

Parameter

b)

Integer

c)

Module

d)

Function

12.

In VB.NET, how is an array of string types declared?

a)

Dim names(9) As String

b)

Dim Array of String(9)

c)

Dim StringArray(names)

d)

Dim String(name) of 9

13.

What is MOD used for?

a)

To find the remainder in a division

b)

To find the in the integer part of a division

c)

To find that value following the decimal point in a division

d)

To find the result of a multiplication

14.

What is DIV used for?

a)

To find the remainder in a division

b)

To find the in the integer part of a division

c)

To find that value following the decimal point in a division

d)

To find the result of a multiplication

15.

Correct use of concatenation in VB.NET...

a)

Writeline("Hello " & name)

b)

Writeline("Hello " and name)

c)

Writeline("Hello ") & name

d)

Writeline("Hello " && name)

16.

In VB.NET (and C#) what is the effect of passing a parameter using ByVal?

a)

If the value passed into the parameter is changed, it is only for that subroutine, while it is running.

b)

If the value passed into the parameter is changed, it is changed in memory.

17.

In VB.NET (and C#) what is the effect of passing a parameter using ByRef?

a)

If the value passed into the parameter is changed, it is only for that subroutine, while it is running.

b)

If the value passed into the parameter is changed, it is changed in memory.

18.

Which of these can be used to make code more readable?

a)

Comments

b)

Indentation

c)

Sensible names for variables and subroutines

d)

Changing the font to Wingdings

19.

Why do we use subroutines?

a)

Allows sections of code to be used multiple times

b)

As a modular approach, it is easier to modify sections of code

c)

To make programming more complicated

d)

To ensure that other programmers can't change the code

20.

What is the main difference between a function and a procedure?

a)

Functions return a value

b)

Procedures return a value

c)

Functions use parameters

d)

Procedures use parameters