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
Two-dimensional arrays are often used to represent ____________.
Tabels
26
Property __________ contains the size of an array.
Length
27
Counter-controlled repetition ______________ the control variable after each iteration.
increments or initializes
28
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
10, 7, and 4
29
Variables appearing in the header of a Function procedure are called ____________.
parameters
30
The first element in every array is the _________.
zeroth element
31
What is one drawback in using non-integer Step sizes?
Round-off error may cause unpredictable results.
32
The smallest data item a computer can process is called a ____________________
bit
33
The initializer list can ___________.
be used to determine the size of the array. be empty contain a comma separated list of initial values for the array elements.
34
Which of the following sotrs array averageRainfall?
Array.Sort(averageRainfall)
35
Methods from the ____________ class can be used to write data to a file
StreamWriter
36
A _____________ contains information that is read in the order it was written.
sequential-access file
37
If the loop is to be executed at least once, the condition should be checked at the __________.
bottom of the loop
38
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
100
39
Method GetUpperBound returns the highest numbered index in an array.
True
40
Arrays that use two indices are referred to as __________ arrays.
two-dimensional
41
Which While statement is equivalent to Until num < 100?
While num >= 100
42
A For...Next loop with a positive step value continues to execute until what condition is met?
The counter variable is greater than the terminating value.
43
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?
Case 1 To 5, 8
44
StreamReader method ___________ reads a line from a file.
ReadLine
45
What is wrong with the following Do loop? Dim index As Integer = 1 Do While index <> 10 lstBox.Items.Add("Hello") index += 2 Loop
It is an infinite loop.
46
Variables and named constants declared inside a procedure are said to have ________________.
local scope
47
When one RadioButton in a container is seleceted, _________.
all others will be deselected
48
Which one of the following is true about arguments and parameters?
Arguments appear in calling statements; parameters appear in Sub statements.
49
The number that refers to a particular element of an array is called its __________
index (or subscript)
50
Sometimes a group of related files is called a _______________.
database
51
Which Case clause will be true whenever the value of the selector in a Select Case block is greater than or equal to 7?
CAse Is >= 7
52
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
Washington
53
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
6
54
A group of related records is stored in a __________
file
55
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?
Names of arguments
56
In a __________ array each row contains the same number of columns.
rectangular
57
Variables appearing inside the parentheses of a calling statement are called ____________.
arguments
58
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?
For i As Integer = 3 To 365 Step 7
59
Which of the following is not a logical operator in Visual Basic?
Then
60
When declaring an array, a(n) _________ is required inside parentheses in order to indicate that the array is two-dimensional.
comma
61
The indexed array name of one-dimensional array units's element 2 is ___________.
units()
62
Methods from class ___________ can be used to read data from a file.
StreamReader
63
An array length is ___________.
one more than the array's last index
64
An array's elements are related by the act that they have the same name and _________.
type
65
The ____________ property determines whether a RadioButton is selected.
Checked
66
The SPORT232 offers ________ digital I/O that are TTL compatible.
24
67
Property ___________ specifies the source of the data displayed in a ComboBox.
DataSource
68
If the Step is omitted, the increment of a For...Next statement default to __________.
1
69
A collection of related radio buttons is usually placed in a _______
Group box
70
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)
For...Next loop
71
An array can store many different types of values
False
72
Digits, letters and special symbols are referred to as ________.
characters
73
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
? 1 2 3 None of the above
74
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 2. Function Cube(num As Double) As Double Return num ^ 3 End Function
1 only & | 2 only
75
After the following Dim statement is executed, how many elements will the array myVar have? Dim myVar(7) As Double
8
76
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
0
77
which one of the following inputs rejects common-mode-noise voltage on the thermocouple leads?
Differential input
78
The name of the Thermocouple Amplifier used in the Black Box Data Acquisition Sysytem is __________________.
Monolithic Thermocouple Amplifier with Cold Junction Compensation
79
Formula to calculate the value in volts, with a 12 bit ADC is:
VADC = (ADC_Count / 4096) * 2.5
80
The _____________ property determine by how much the current number in a NumericUpDown control changes when the user clicks the up arrow or down arrow.
Increment
81
Data maintained in a file is called __________ .
secondary data
82
An array index store normally should be of type Double.
False
83
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
10
84
To determine the number of elements in an array, use the NumberOfElements property
False
85
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)
var1 is not of the same data type as "The Jetsons."
86
A(n) __________ is an encapsulation of data and code that operates on the data.
object
87
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
3
88
If the Step is omitted, the increment of a For...Next statement defaults to ______________.
1 or | -1
89
The For...Next header specifies ____________.
control variable and initial value increment or decrement loop continuation condition
90
An infinite loop occurs when the loop-continuation condition in a Do While...Loop or Do...Loop While statement _______________
nver becomes False
91
A(n) __________ allows the user to select a file to open.
OpenFileDialog
92
Typically, ____________ statements are used to iterate over each element in a two-dimensional array.
nested For...Next
93
The input to a user-defined function can consist of:
a single value one or more values no values
94
The Do...Loop Until statement checks the loop-termination condition ____________
for True after the body executes
95
Variables appearing inside the parentheses of a calling statement are called ____________
arguments