Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Quiz 2 Sept 2021 FBT0025 Visual Programming

Total questions: 30

Worksheet time: 1hrs 1mins

Name
Class
Date
1.

A variable declared inside an event procedure is said to have local scope

a)

True

b)

False

2.

The value returned by InputBox is a string

a)

True

b)

False

3.

Option Explicit requires you to declare every variable before its use

a)

True

b)

False

4.

What is the correct statement when declaring and assigning the value of 100 to an Integer variable called numPeople

a)

Dim numPeople =

b)

Dim numPeople = Int(100)

c)

numPeople = 100

d)

Dim numPeople As Integer = 100

5.

Which of the following arithmetic operations has the highest level of precedence ?

a)

+ –

b)

* /

c)

^ exponentiation

d)

( )

6.

What value will be assigned to the numeric variable x when the following statement is executed ? x = 2 + 3 * 4

a)

20

b)

14

c)

92

d)

234

7.

Which of the following is a valid name for a variable ?

a)

Two_One

b)

2One

c)

Two One

d)

Two.One

8.

What is the proper syntax when using a message dialog box ?

a)

MessageBox.Show(“Hi there”, “Hi”)

b)

MessageBox.Show(Hi there, Hi)

c)

MessageBox.Show “Hi There”, “Hi”

d)

MessageBox.Show Hi There, Hi

9.

Which of the following is a valid Visual Basic conditional statement ?

a)

2 < n < 5

b)

2 < n Or < 5

c)

2 < n Or 5

d)

(2 < n) Or (n < 5)

10.

The three main logical operators are ________, _________, and ________.

a)

And, Or, Not

b)

And, Not, If

c)

Or, Not, If

d)

False, And, True

11.

Suppose a variable is passed by value to a parameter of a Sub procedure, and the parameter has its value changed inside the Sub procedure. What will the value of the variable be after the Sub procedure has executed ?

a)

It will have the newly modified value from inside the Sub procedure

b)

Its value cannot be determined without more information

c)

It will retain the value it had before the call to the Sub procedure

d)

None of the above

12.

Suppose the variable myName is declared in a Dim statement in two different Sub procedures. Which statement is true ?

a)

The program will malfunction when it is executed

b)

When the value of myName is changed in one Sub procedure, it will also be changed in the other Sub procedure

c)

Visual Basic’s smart editor will alert you that this is an error before the program is executed

d)

The two variables will be local to their respective Sub procedures

13.

The Properties window plays an important role in the development of Visual Basic applications. It is mainly used

a)

To change how objects look and feel

b)

When opening programs stored on a hard drive

c)

To allow the developer to graphically design program components

d)

To set program related options like Program Name, Program Location, etc

14.

Which of the properties in a control’s list of properties is used to give the control a meaningful name ?

a)

Text

b)

ContextMenu

c)

ControlName

d)

Name

15.

A tool is selected by double clicking it or drag it onto the form.

a)

True

b)

False

16.

Different version of VB.NET may have different set of tools.

a)

True

b)

False

17.

Forms and controls are objects which produces/responds to events.

a)

True

b)

False

18.

What is the prefixes for control names below :


Radio Button

(a)  

19.

What is the constant value for button in the MessageBoxStyle : vbYesNoCancel ? It able to display Yes, No and Cancel buttons.

a)

1

b)

2

c)

3

d)

4

20.

A variable is a storage location in the computer's memory, used for holding permanently while the program is running.

a)

True

b)

False

21.

Which of the following are not the data type of integer ?

a)

Long

b)

Integer

c)

Decimal

d)

Byte

22.

lblDate.Text = "Today is " & Date.TimeOfDay


The statement above is to retrieving the current date and time. Which one is the keyword yield the current time only ?

a)

Today is

b)

TimeOfDay

c)

lblDate

d)

&

23.

(a)   variables are declared in general declarations area (before any code is entered) with Dim statement. It can be recognized by all the procedures in the class

24.

Which of the following is a false statement for constants variable ?

a)

Any changes after the calculation will effect the data inside constant

b)

Name all constant for your program in one location

c)

To change the value of a constant, we need to change where we declare it

d)

Use of constant will ease every programmer in reading the code

25.

An if statement is considered as a relational operators where its condition will return true result only.

a)

False

b)

True

26.

OrElse operator is more efficient than Or because

a)

OrElse stops evaluating and turn the entire expressions to TRUE when the first TRUE expression is found, but Or evaluates all

b)

OrElse stops evaluating and turn the entire expressions to TRUE when the first FALSE expression is found, but Or evaluates all

27.

Module decisions

Sub Main()

Dim a As Integer = 100

If (a < 20) Then

Console.WriteLine("a is less than 50")

Else

Console.WriteLine("a is not less than 80")

End If

Console.WriteLine("value of a is : {0}", a)

Console.ReadLine()

End Sub

End Module

a)

a is not less than 80

value of a is : 100

b)

a is less than 80

value of a is : 100

c)

a is not less than 50

value of a is : 100

d)

a is less than 50

value of a is : 100

28.

What is the answer if A = 1 OR B = 0 ?

(a)  

29.

How to close a CASE statements ?

a)

Select Case

b)

Select End

c)

Endif

d)

End Select

30.

Can be used to compare numerical data and string data.

a)

Logical Operators

b)

Relational Operators