wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Quiz 2 DFP4013

Total questions: 10

Worksheet time: 13mins

Name
Class
Date
1.

Write an If clause that determines whether the value in the dblPay variable is at least 10.45.

a)

If dblPay >= 10.45 Then

b)

If dblPay > 10.45 Then

c)

If dblPay >> 10.45 Then

d)

If dblPay = 10.45 Then

2.

Write an If clause that determines whether the blnIsInsured variable contains the keyword True.

a)

If blnIsInsured.enable = True Then

b)

If blnIsInsured = True Then

c)

If blnIsInsured = 'True' Then

d)

If blnIsInsured == True Then

3.

Which flowchart symbol represents the condition in a multiple-alternative selection structure?

a)

Diamond

b)

Arrow

c)

Rectangle

d)

Oval

4.

If the intCode variable is used as the selectorExpression in a Select Case statement, which of the following is a valid Case clause?

a)

Case 1, 2, 3

b)

Case "1", "2", "3"

c)

Case 1 Through 3

d)

Case 1 To 3

5.

Write a Case clause that specifies all numbers less than 0.

a)

Case Is less than 0

b)

Case Is 'Negatif'

c)

Case Is > 0

d)

Case Is < 0

6.

If the loop’s For clause is For intX = 2 To 8 Step 2, how many times will the loop instructions be processed?

a)

1

b)

2

c)

4

d)

8

7.

What will the following code display in the lblAsterisks control?

For intX As Integer = 1 To 2

For intY As Integer = 1 To 3

lblAsterisks.Text = lblAsterisks.Text & "*"

Next intY

lblAsterisks.Text = lblAsterisks.Text & ControlChars.NewLine

a)

***

***

b)

**

**

**

c)

**

**

d)

***

***

***

8.

What will the following code display in the lblSum control?

Dim intSum As Integer

Dim intY As Integer


Do While intY < 3

For intX As Integer = 1 To 4

intSum += intX

Next intX

intY += 1

Loop

lblSum.Text = intSum.ToString

a)

5

b)

8

c)

15

d)

30

9.

Using the While keyword, write a Loop clause that processes the loop body as long as the value in the intAge variable is greater than 21.

a)

Loop While intAge > 21

b)

Loop While intAge >= 21

c)

Loop Until intAge > 21

d)

Loop Until intAge >= 21

10.

Using the Until keyword, write a Loop clause that stops the loop when the value in the strContinue variable contains the letter N (in either uppercase or lowercase).

a)

Loop While strContinue.ToUpper = "N"

b)

Loop While strContinue = "N"

c)

Loop Until strContinue.ToUpper = "N"

d)

Loop Until strContinue= "N"