final exam review Flashcards

1
Q

The ____________ property determines whether a RadioButton is selected.

A) Selected
B) Clicked
C) Checked
D) Enabled

A

C) Checked

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

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

A) single-subscripted
B) two-dimensional
C) double
D) one-dimensional

A

B) two-dimensional

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

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

A) constant value
B) subscript
C) type
D) value

A

C) type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
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
B) For i As Integer = 1 to 365 Step 3
C) For i As Integer = 365 To 1 Step -7
D) For i As Integer = 3 to 365 Step 6

A

A) For i As Integer = 3 To 365 Step 7

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
Formula to calculate the value in volts, with a 12 bit ADC is:
A) 	VADC  = (ADC_Count / 4096) * 2.5
B) 	VADC = ADC_Count / 4096 / 2.5
C) 	VADC = ADC_Count * 4096 / 25
D) 	VADC = ADC_Count * 4096 / 2.5
A

A) VADC = (ADC_Count / 4096) * 2.5

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q
If the Step is omitted, the increment of a For...Next statement defaults to \_\_\_\_\_\_\_\_\_\_\_\_\_\_.
A) 	1
B) 	-1
C) 	0
D) 	Either answer 1 or 2
A

A) 1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
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 both thermocouple leads become close.
B) if one thermocouple lead is close.
C) if one or both thermocouple leads become open
D) None of the above

A

C) if one or both thermocouple leads become open

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
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) 	Number of arguments
B) 	Names of arguments
C) 	Data type of arguments
D) 	Order of arguments
A

B) Names of arguments

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q
An infinite loop occurs when the loop-continuation condition in a Do While...Loop or Do...Loop While statement \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_.
A) 	never becomes True
B) 	never becomes False
C) 	is False
D) 	is tested repeatedly
A

B) never becomes False

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

In order to communicate with Wiz232 board, COM port parameters must be set as:
Incorrect Response
A) 9600 baud, no parity, 12 data bits and 1 stop bit
B) 9600 baud, no parity, 8 data bits, 1 stop bit
C) 2400 baud, no parity, 7 data bits, 1 stop bit
D) 9600 baud, no parity, 8 data bits and 2 stop bits

A

B) 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
11
Q
Variables appearing inside the parentheses of a calling statement are called \_\_\_\_\_\_\_\_\_\_\_\_.
A) 	values of the function
B) 	parameters
C) 	coordinates
D) 	arguments
A

D) arguments

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q
Arrays can be declared to hold values of \_\_\_\_\_.
A) 	type Double
B) 	type Integer
C) 	type String
D) 	any data type
A

D) any data type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
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
B) 	Case Is = 8
C) 	CAse Is >= 7
D) 	Case Is <= 8
A

C) CAse Is >= 7

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
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

C) 3

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
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) Two, Great, and Equal
B) Great and Equal
C) Great
D) Equal

A

C) Great

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q
The first element in every array is the \_\_\_\_\_\_\_\_\_.
A) 	subscript
B) 	zeroth element
C) 	length of the array
D) 	smallest value in the array
A

B) zeroth element

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q
If the Step is omitted, the increment of a For...Next statement default to \_\_\_\_\_\_\_\_\_\_.
A) 	1
B) 	-1
C) 	0
D) 	0.0
A

A) 1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q
Which one of the following inputs rejects common-mode-noise voltage on the thermocouple leads?
A) 	Differential input
B) 	integral input
C) 	common mode input
D) 	common reject input
A

A) Differential input

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q
What keyword in the header of a sub procedure denotes that a variable is passed by reference?
A) 	AsRef
B) 	ByReference
C) 	ByRef
D) 	ByVal
A

C) ByRef

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q
The SPORT232 offers \_\_\_\_\_\_\_\_ digital I/O that are TTL compatible.
A) 	12
B) 	16
C) 	20
D) 	24
A

D) 24

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q
Which of the following sotrs array averageRainfall?
A) 	Array(averageRainfall).Sort()
B) 	Sort.Array(averageRainfall)
C) 	Sort(averageRainfall)
D) 	Array.Sort(averageRainfall)
A

D) Array.Sort(averageRainfall)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q
The expression \_\_\_\_\_\_\_ creates an Integer array of two rows and five columns.
A) 	Dim a(2,5) As Integer
B) 	Dim a(1,5) As Integer
C) 	Dim a(1,4) As Integer
D) 	Dim a(2,4) As Integer
A

C) Dim a(1,4) As Integer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q
The indexed array name of one-dimensional array units's element 2 is \_\_\_\_\_\_\_\_\_\_\_.
A) 	units{2}
B) 	units()
C) 	units[0,2]
D) 	units[2]
A

B) units()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
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) WashWashington
B) Washington
C) WASHINGTONwashington
D) No output

A

B) Washington

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
An array index store normally should be of type Double. A) True B) False
B) False
26
``` An array length is ___________. A) one more than the array's last index B) one less than the arry's last index C) the same as the arry's ndex D) returned by method GetUpperBound ```
A) one more than the array's last index
27
``` A(n) __________ allows the user to select a file to open. A) CreateFileDialog B) OpenFileDialog C) MessageBox D) None of the above ```
B) OpenFileDialog
28
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 A) 1 only B) 2 only C) Both 1 and 2 D) Neither 1 nor 2
C) Both 1 and 2
29
``` A collection of related radio buttons is usually placed in a _______ . A) List box B) Text box C) Combo box D) Group box ```
D) Group box
30
``` The process of ordering the elements of an array is called ___________ the array. A) allocating B) sorting C) declaring D) initializing ```
B) sorting
31
``` The ComboBox control combines a TextBox control with a _______ control. A) DateTimePicker B) ListBox C) NumericUpWown D) Label ```
B) ListBox
32
The name of the Thermocouple Amplifier used in the Black Box Data Acquisition Sysytem is __________________. A) Monolithic Thermocouple Amplifier with Cold Junction Compensation B) Duallithic Thermocouple Amplifier with Cold Junction C) Monolithic Thermocouple without Cold Junction Compensation D) Duallithic Amplifier without Cold Junction Compensation
A) Monolithic Thermocouple Amplifier with Cold Junction Compensation
33
``` Method _________ returns an array's highest index. A) GetUpperBound B) GetUpperLimit C) GetHighestIndex D) GeUpperSubscript ```
A) GetUpperBound
34
``` Variables and named constants declared inside a procedure are said to have ________________. A) local scope B) procedure-level scope C) class-level scope D) method-level scope ```
A) local scope
35
``` Property ___________ specifies the source of the data displayed in a ComboBox. A) ComboData B) Source C) DataList D) DataSource ```
D) DataSource
36
Which one of the following is true about arguments and parameters? A) Arguments appear in calling statements; parameters appear in Sub statements. B) Parameters appear in calling statements; arguments appear in Sub statements. C) They are synonymous terms. D) They are completely unrelated terms in a program.
A) Arguments appear in calling statements; parameters appear in Sub statements.
37
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. B) The counter variable is equal to or greater than the terminating value. C) The counter variable is less than the terminating value. D) The counter variable is less than or equal to the terminating value.
A) The counter variable is greater than the terminating value.
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 ``` A) 0 B) 100 C) 10 D) 1
B) 100
39
Method GetUpperBound returns the highest numbered index in an array. A) True B) False
A) True
40
``` After the following Dim statement is executed, how many elements will the array myVar have? Dim myVar(7) As Double ``` A) 0 B) 1 C) 8 D) 9
C) 8
41
``` Use a ___________ to group of RadioButtons on a Form. A) GroupBox control B) ComboBox control C) ListBox control D) None of the above ```
D) None of the above
42
``` 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) Amount B) Step C) Increment D) Next ```
C) Increment
43
``` Namespace ____________ provides the classes and methods you need to perform file processing. A) System.IO B) System.Files C) System.Stream D) System.Windows.Forms ```
A) System.IO
44
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} B) Dim array() As Integer = {1,2,3},{4,5,6},{7,8,9} C) Dim array(,) As Integer = {1,2,3},{4,5,6},{7,8,9} D) All of the above
C) Dim array(,) As Integer = {1,2,3},{4,5,6},{7,8,9}
45
``` The ___________ event is raised when a RadioButton is either selected or deselected. A) checkedChanged B) Changed C) SelectedChanged D) None of the above ```
A) checkedChanged
46
``` Which While statement is equivalent to Until num < 100? A) While num 100 C) While num >= 100 D) There is no equivalent While statement. ```
C) While num >= 100
47
``` A group of related records is stored in a __________. A) file B) field C) bit D) byte ```
A) file
48
``` Methods from class ___________ can be used to read data from a file. A) Stream Writer B) StreamReader C) FileReader D) FileWriter ```
B) StreamReader
49
``` Property __________ contains the size of an array. A) Elements B) ArraySize C) Length D) Size ```
C) Length
50
``` A _____________ contains information that is read in the order it was written. A) sequential-access file B) StreamWriter C) StreamReader D) Random-access file ```
A) sequential-access file
51
``` When declaring an array, a(n) _________ is required inside parentheses in order to indicate that the array is two-dimensional. A) comma B) astrisk C) period D) apostrophe ```
A) comma
52
``` Methods from the ____________ class can be used to write data to a file. A) StreamReader B) WriteFile C) StreamWriter D) ReadFile ```
C) StreamWriter
53
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 B) the maximum value that can be assigned to any element in the array scores C) the data type for the array scores D) the value initially assigned to each element in the array scores
A) the highest value of the subscripts of the elements for the array scores
54
``` 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) 0 B) 50 C) 15 D) 25 ```
B) 50
55
``` 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 8 B) Case 1 To 5, 8 C) Case 1 To 8, 5 D) Case 1 To 5; 8 ```
B) Case 1 To 5, 8
56
When one RadioButton in a container is seleceted, _________. A) other can be selected at the same time B) a logic error will occur C) all others will be deselected D) Both 1 an 2
C) all others will be deselected
57
``` Sometimes a group of related files is called a _______________. A) field B) database C) collection D) byte ```
B) database
58
``` Variables appearing in the header of a Function procedure are called ____________. A) parameters B) coordinates C) arguments D) constants ```
A) parameters
59
``` The AD594/AD595 instrumentation amplifier produces a high level __________ output directly from a thermocouple signal. A) 5 mV/oC B) 10 mV/oC C) 15 mV/oC D) 5 V/oC ```
B) 10 mV/oC
60
``` The input to a user-defined function can consist of: A) a single value B) one or more values C) no values D) All of the above ```
D) All of the above
61
``` The ________ event handler is invoked when the user selects a Radio button. A) Selected B) CheckedChanged C) ButtonChanged D) CheckedSelected ```
B) CheckedChanged
62
``` Which of the following is not a logical operator in Visual Basic? A) Not B) And C) Or D) Then ```
D) Then
63
``` In a __________ array each row contains the same number of columns. A) data B) rectangular C) tabular D) All of the above ```
B) rectangular
64
To determine the number of elements in an array, use the NumberOfElements property A) True B) False
B) False
65
``` Which of the following creates an Integer array of five rows and three colums? A) Dim values(5.3) As Integer B) Dim values(4,2) As Integer C) Dim values(4,3) As Integer D) Dim values(5,2) As Integer ```
B) Dim values(4,2) As Integer
66
``` Counter-controlled repetition ______________ the control variable after each iteration. A) increments B) initializes C) decrements D) Either answer 1 or 2 ```
D) Either answer 1 or 2
67
``` A(n) __________ is an encapsulation of data and code that operates on the data. A) object B) driver C) decision D) module ```
A) object
68
``` 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) 5 B) 9 C) 6 D) 4
C) 6
69
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) It is not valid to pass something like "The Jetsons." B) Constant valus like 1000 cannot be passed, only variables. C) var1 is not of the same data type as "The Jetsons." D) Nothing is wrong with them.
C) var1 is not of the same data type as "The Jetsons."
70
``` Two-dimensional arrays are often used to represent ____________. A) a pie chart B) distances C) lines D) Tabels ```
D) Tabels
71
``` 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 B) 2 C) 3 D) None of the above ```
C) 3
72
The initializer list can ___________. A) be used to determine the size of the array. B) be empty C) contain a comma separated list of initial values for the array elements. D) all of the above
D) all of the above
73
What is one drawback in using non-integer Step sizes? A) Round-off error may cause unpredictable results. B) Decimal Step size are invalid in VB. C) A decimal Step size is never needed. D) Decimal Step sizes usually produce infinite loops.
A) Round-off error may cause unpredictable results.
74
``` 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) 8 B) 9 C) 10 D) 11
C) 10
75
``` 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 should have been written as a Do Until loop. B) It is an infinite loop. C) The test variable should be changed within the loop itself. D) Nothing
B) It is an infinite loop.
76
``` 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) Do While...Loop structure B) Do...Loop Until structure C) For...Next loop D) While...End While structure ```
C) For...Next loop
77
``` ComboBox property ____________ is 0 when the first ComboBox item is selected. A) SelectedIndex B) SElectedValue C) Index D) SelectedNumber ```
A) SelectedIndex
78
An array can store many different types of values A) True B) False
B) False
79
``` What aspect of the control variable determines whether looping should continue? A) name B) initial value C) type D) final value ```
D) final value