Final Sample Quiz Flashcards

1
Q

What keyword in the header of a sub procedure denotes that a variable is passed by reference?

A

ByRef

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

The linear search works well for unsorted arrays.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

SPORT232 Data Acquisition and Control board has _________ analog input channels to connect to sensors, such as thermocopules, pH probes, photocells, strain gauge, etc.

A

11

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

In an m-by-n array, the m stands for __________

A

the number of rows in the array

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Namespace ____________ provides the classes and methods you need to perform file processing.

A

System.IO

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

The main function of AD594/AD595 instrumentation amplifier includes a thermocouple failure alarm. The main function of this thermocouple failure alarm is to indicates _______________________ .

A

if one or both thermocouple leads become open

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

In the statement

Dim scores(30) As Double

the number 30 designates which of the following?

A

the highest value of the subscripts of the elements for the array scores

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Which of the following creates an Integer array of five rows and three colums?

A

Dim values(4,2) As Integer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

The AD594/AD595 instrumentation amplifier produces a high level __________ output directly from a thermocouple signal.

A

10 mV/oC

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What will be displayed when the button is clicked on?

Private Sub btnDisplay_Click(…) Handles btnDisplay.Click

Dim lng, wid As Double

lng = 5

wid = 10

ComputeArea(lng, wid)

End Sub

Sub ComputeArea(length As Double, width As Double)

Dim area As Double

area = length * width

txtBox.Text = CStr(area)

End Sub

A

50

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

The process of ordering the elements of an array is called ___________ the array.

A

sorting

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

In order to communicate with Wiz232 board, COM port parameters must be set as:

A

9600 baud, no parity, 8 data bits, 1 stop bit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What will be the final value of count variable once the following segment of VB is executed?

Dim count As Integer = 1

Do Until count > 10

count += 1

Loop

txt_out.Text = count

A

11

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

The __________ property is set to True when a RadioButton is selected.

A

Checked

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Which of the following statements creates Integer array values with three rows and three columns?

A

Dim array(,) As Integer = {1,2,3},{4,5,6},{7,8,9}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

The ComboBox control combines a TextBox control with a _______ control.

A

ListBox

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

The ___________ event is raised when a RadioButton is either selected or deselected.

A

checkedChanged

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What aspect of the control variable determines whether looping should continue?

A

final value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Which method call sorts array words in ascending order?

A

Array.Sort(words)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Arrays can be declared to hold values of _____.

A

any data type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What word(s) will appear in the list box when the button is clicked?

Private Sub btnDisplay_Click(…) Handles btnDisplay.Click

Dim num As Integer = 5

If num = 2 Then

lstBox.Items.Add(“Two”)

ElseIf num > 3 Then

lstBox.Items.Add(“Great”)

ElseIf num = 5 Then

lstBox.Items.Add(“Equal”)

End If

End Sub

A

Great

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

How many times will HI be displayed when the following lines are executed?

Dim c As Integer = 12

Do

lstBox.Items.Add(“HI”)

c += 3

Loop Until (c >= 30)

A

6

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

The ________ event handler is invoked when the user selects a Radio button.

A

CheckedChanged

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

The expression _______ creates an Integer array of two rows and five columns.

A

Dim a(1,4) As Integer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

Two-dimensional arrays are often used to represent ____________.

A

Tabels

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

Property __________ contains the size of an array.

A

Length

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

Counter-controlled repetition ______________ the control variable after each iteration.

A

increments
or
initializes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

What numbers will be displayed in the list box when the button is clicked?

Private Sub btnDisplay_Click(…) Handles btnDisplay.Click

Dim num as Double = 10

Do While num > 1

lstBox.Items.Add(num)

num = num - 3

Loop

End Sub

A

10, 7, and 4

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

Variables appearing in the header of a Function procedure are called ____________.

A

parameters

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

The first element in every array is the _________.

A

zeroth element

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

What is one drawback in using non-integer Step sizes?

A

Round-off error may cause unpredictable results.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

The smallest data item a computer can process is called a ____________________

A

bit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

The initializer list can ___________.

A

be used to determine the size of the array.

be empty

contain a comma separated list of initial values for the array elements.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

Which of the following sotrs array averageRainfall?

A

Array.Sort(averageRainfall)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

Methods from the ____________ class can be used to write data to a file

A

StreamWriter

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

A _____________ contains information that is read in the order it was written.

A

sequential-access file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

If the loop is to be executed at least once, the condition should be checked at the __________.

A

bottom of the loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q

What will be the output of the following VB code?

Dim count as integer = 0

While count <= 10

txtOut.Text = count * count

count += 1

End While

A

100

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q

Method GetUpperBound returns the highest numbered index in an array.

A

True

40
Q

Arrays that use two indices are referred to as __________ arrays.

A

two-dimensional

41
Q

Which While statement is equivalent to

Until num < 100?

A

While num >= 100

42
Q

A For…Next loop with a positive step value continues to execute until what condition is met?

A

The counter variable is greater than the terminating value.

43
Q

Which Case clause will be true whenever the value of the selector in a Select Case block is between 1 and 5 or is 8?

A

Case 1 To 5, 8

44
Q

StreamReader method ___________ reads a line from a file.

A

ReadLine

45
Q

What is wrong with the following Do loop?

Dim index As Integer = 1

Do While index <> 10

lstBox.Items.Add(“Hello”)

index += 2

Loop

A

It is an infinite loop.

46
Q

Variables and named constants declared inside a procedure are said to have ________________.

A

local scope

47
Q

When one RadioButton in a container is seleceted, _________.

A

all others will be deselected

48
Q

Which one of the following is true about arguments and parameters?

A

Arguments appear in calling statements; parameters appear in Sub statements.

49
Q

The number that refers to a particular element of an array is called its __________

A

index (or subscript)

50
Q

Sometimes a group of related files is called a _______________.

A

database

51
Q

Which Case clause will be true whenever the value of the selector in a Select Case block is greater than or equal to 7?

A

CAse Is >= 7

52
Q

What will be the output of the following program when the button is clicked?

Private Sub btnDisplay_Click(…) Handles btnDisplay.Click

Dim name As String = “Washington”

Select Case name

Case “George”

txtBox.Text = “George”

Case “Wash”

txtBox.Text = “Wash”

Case “WASHINGTON”

txtBox.Text = “WASHINGTON”

Case Else

txtBox.Text = “Washington”

End Select

End Sub

A

Washington

53
Q

What will be displayed by the following program when the button is clicked?

Private Sub btnDisplay_Click(…) Handles btnDisplay.Click

Dim s As Double

s = 0

For k As Integer = 1 To 5

If k / 2 = Int(k / 2) Then

s += k

End If

Next

txtBox.Text = CStr(s)

End Sub

A

6

54
Q

A group of related records is stored in a __________

A

file

55
Q

The arguments appearing in a calling statement must match the parameters in the appropriate Sub or Function header in all but one of the following ways. Which one?

A

Names of arguments

56
Q

In a __________ array each row contains the same number of columns.

A

rectangular

57
Q

Variables appearing inside the parentheses of a calling statement are called ____________.

A

arguments

58
Q

Suppose the days of the year are numbered from 1 to 365 and January 1st falls on a Tuesday as it did in 2013. What is the correct For statement to use if you want only the numbers for the Fridays in 2013?

A

For i As Integer = 3 To 365 Step 7

59
Q

Which of the following is not a logical operator in Visual Basic?

A

Then

60
Q

When declaring an array, a(n) _________ is required inside parentheses in order to indicate that the array is two-dimensional.

A

comma

61
Q

The indexed array name of one-dimensional array units’s element 2 is ___________.

A

units()

62
Q

Methods from class ___________ can be used to read data from a file.

A

StreamReader

63
Q

An array length is ___________.

A

one more than the array’s last index

64
Q

An array’s elements are related by the act that they have the same name and _________.

A

type

65
Q

The ____________ property determines whether a RadioButton is selected.

A

Checked

66
Q

The SPORT232 offers ________ digital I/O that are TTL compatible.

A

24

67
Q

Property ___________ specifies the source of the data displayed in a ComboBox.

A

DataSource

68
Q

If the Step is omitted, the increment of a For…Next statement default to __________.

A

1

69
Q

A collection of related radio buttons is usually placed in a _______

A

Group box

70
Q

When the number of repetitions needed for a set of instructions is known before they are executed in a program, the best repetition structure to use is a(n)

A

For…Next loop

71
Q

An array can store many different types of values

A

False

72
Q

Digits, letters and special symbols are referred to as ________.

A

characters

73
Q

What will be displayed by the following program when the button is clicked?

Private Sub btnDisplay_Click(…) Handles btnDisplay.Click

Dim a, b, c, x As Double

a = 5

b = 3

c = 6

If a > c Then

x = 1

Else

If b > c Then

x = 2

Else

x = 3

txtBox.Text = CStr(x)

End If

End If

End Sub

A

?

1

2

3

None of the above

74
Q

Consider the following event procedure that calls a Function procedure named Cube, which returns the cube of a number.

Private Sub btnDisplay_Click(…) Handles btnDisplay.Click

Dim num, result As Double

num = CDbl(InputBox(“Enter a number to cube:”))

result = Cube(num)

txtBox.Text = “The cube of “ & num & “ is “ & result & “.”

End Sub

Which of the following is a correct Function definition for Cube?

  1. Function Cube(var As Double) As Double

Return var ^ 3

End Function

  1. Function Cube(num As Double) As Double

Return num ^ 3

End Function

A

1 only &

2 only

75
Q

After the following Dim statement is executed, how many elements will the array myVar have?

Dim myVar(7) As Double

A

8

76
Q

What will be the output of the following program when the button is clicked on?

Private Sub btnDisplay_Click(…) Handles btnDisplay.Click

Dim var1, var2, num As Integer

var1 = 2

var2 = 4

num = 6

Add(num)

txtBox.Text = CStr(num)

End Sub

Sub Add(ByRef num As Integer)

Dim var1, var2 As Integer

num = var1 + var2

End Sub

A

0

77
Q

which one of the following inputs rejects common-mode-noise voltage on the thermocouple leads?

A

Differential input

78
Q

The name of the Thermocouple Amplifier used in the Black Box Data Acquisition Sysytem is __________________.

A

Monolithic Thermocouple Amplifier with Cold Junction Compensation

79
Q

Formula to calculate the value in volts, with a 12 bit ADC is:

A

VADC = (ADC_Count / 4096) * 2.5

80
Q

The _____________ property determine by how much the current number in a NumericUpDown control changes when the user clicks the up arrow or down arrow.

A

Increment

81
Q

Data maintained in a file is called __________ .

A

secondary data

82
Q

An array index store normally should be of type Double.

A

False

83
Q

How many lines of output are produced by the following program segment?

For i As Integer = 1 To 3

For j As Integer = 1 To 3

For k As Integer = i to j

lstBox.Items.Add(“Programming is fun.”)

Next

Next

Next

A

10

84
Q

To determine the number of elements in an array, use the NumberOfElements property

A

False

85
Q

What is wrong with the following calling statement and its corresponding Sub statement?

MyProcedure(“The Jetsons”, 1000, 209.53)

Sub MyProcedure(var1 As Double, var2 As Double,

var3 As Double)

A

var1 is not of the same data type as “The Jetsons.”

86
Q

A(n) __________ is an encapsulation of data and code that operates on the data.

A

object

87
Q

What will be displayed when the button is clicked?

Private Sub btnDisplay_Click(…) Handles btnDisplay.Click

Dim num As Double = 9

Dim sqrRoot As Double

If num

A

3

88
Q

If the Step is omitted, the increment of a For…Next statement defaults to ______________.

A

1 or

-1

89
Q

The For…Next header specifies ____________.

A

control variable and initial value

increment or decrement

loop continuation condition

90
Q

An infinite loop occurs when the loop-continuation condition in a Do While…Loop or Do…Loop While statement _______________

A

nver becomes False

91
Q

A(n) __________ allows the user to select a file to open.

A

OpenFileDialog

92
Q

Typically, ____________ statements are used to iterate over each element in a two-dimensional array.

A

nested For…Next

93
Q

The input to a user-defined function can consist of:

A

a single value

one or more values

no values

94
Q

The Do…Loop Until statement checks the loop-termination condition ____________

A

for True after the body executes

95
Q

Variables appearing inside the parentheses of a calling statement are called ____________

A

arguments