70+ Dot Net Architecture and Program Solved MCQs

1.

The Visual Basic Code Editor will automatically detect certain types of errors as you are entering code.

A. true
B. false
Answer» A. true
2.

Keywords are also referred to as reserved words.

A. true
B. false
Answer» A. true
3.

The divide-and-conquer-method of problem solving breaks a problem into large, general pieces first, then refines each piece until the problem is manageable.

A. true
B. false
Answer» A. true
4.

Visual Basic responds to events using which of the following?

A. a code procedure
B. an event procedure
C. a form procedure
D. a property
Answer» B. an event procedure
5.

When the user clicks a button, _________ is triggered.

A. an event
B. a method
C. a setting
D. a property
Answer» A. an event
6.

What property of controls tells the order they receive the focus when the tab key is pressed during run time?

A. focus order
B. focus number
C. tab index
D. control order
Answer» C. tab index
7.

Sizing Handles make it very easy to resize virtually any control when developing applications with Visual Basic. When working in the Form Designer, how are these sizing handles displayed?

A. a rectangle with 4 arrows, one in each corner, around your control.
B. a 3-d outline around your control.
C. a rectangle with small squares around your control.
D. none of the above.
Answer» C. a rectangle with small squares around your control.
8.

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.
Answer» A. to change how objects look and feel.
9.

When creating a new application in Visual Basic, you are asked to supply a name for the program. If you do not specify a name, a default name is XXXXX XXXXX is this default name?

A. wapplication followed by a number.
B. application followed by a number.
C. windowsapplication.
D. windowsapplication followed by a number.
Answer» B. application followed by a number.
10.

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
Answer» D. name
11.

An algorithm is defined as:

A. a mathematical formula that solves a problem.
B. a tempo for classical music played in a coda.
C. a logical sequence of steps that solve a problem.
D. a tool that designs computer programs and draws the user interface.
Answer» C. a logical sequence of steps that solve a problem.
12.

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

A. true
B. false
Answer» A. true
13.

A variable declared outside of an event procedure is said to have class-level scope.

A. true
B. false
Answer» A. true
14.

Option Explicit requires you to declare every variable before its use.

A. true
B. false
Answer» A. true
15.

The value returned by InputBox is a string.

A. true
B. false
Answer» A. true
16.

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
Answer» D. dim numpeople as integer = 100
17.

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

A. + –
B. * /
C. ^ exponentiation
D. ( )
Answer» C. ^ exponentiation
18.

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
Answer» B. 14
19.

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

A. two_one
B. 2one
C. two one
D. two.one
Answer» A. two_one
20.

Keywords in Visual Basic are words that

A. should be used when naming variables.
B. are used to name controls, such as textbox1, command2, etc.
C. have special meaning and should not be used when naming variables.
D. are used as prefixes for control names (such as txt, btn, lbl, and lst).
Answer» C. have special meaning and should not be used when naming variables.
21.

To continue a long statement on another line, use:

A. an underscore character.
B. an ampersand character.
C. ctrl + enter.
D. a space followed by an underscore character.
Answer» A. an underscore character.
22.

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
Answer» A. messagebox.show(“hi there”, “hi”)
23.

What will be the output of the following statement? txtBox.Text = FormatCurrency(1234.567)

A. $1234.567
B. 1,234.57
C. $1234.57
D. $1,234.57
Answer» D. $1,234.57
24.

The following lines of code are correct. If age >= 13 And < 20 Then txtOutput.Text = “You are a teenager.” End If

A. true
B. false
Answer» B. false
25.

Given that x = 7, y = 2, and z = 4, the following If block will display “TRUE”. If (x > y) Or (y > z) Then txtBox.Text = “TRUE” End If

A. true
B. false
Answer» A. true
26.

Asc(“A”) is 65. What is Asc(“C”)?

A. 66
B. 67
C. 68
D. “c”
Answer» B. 67
27.

Asc(“A”) is 65. What is displayed by txtBox.Text = Chr(65) & “BC”?

A. abc
B. a bc
C. 656667
D. not enough information is available.
Answer» A. abc
28.

Which of the following expressions has as its value the words “Hello World? surrounded by quotation marks?

A. “hello world”
B. chr(34) & “hello world”
C. chr(34) & hello world & chr(34)
D. chr(34) & “hello world” & chr(34)
Answer» A. “hello world”
29.

Which of the following is true?

A. “cat” = “cat”
B. “cat” < “cat”
C. “cat” > “cat”
D. relational operators are only valid for numeric values.
Answer» B. “cat” < “cat”
30.

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)
Answer» D. (2 < n) or (n < 5)
31.

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

A. and, or, not
B. and, not, if
C. or, not, if
D. false, and, true
Answer» A. and, or, not
32.

Which value for x would make the following condition true: x >= 5

A. x is equal to 7
B. x is equal to 5
C. x is equal to 5.001
D. all of the above
Answer» D. all of the above
33.

Which value for x would make the following condition true: Not (x >= 5)

A. x is equal to 7
B. x is equal to 4
C. x is equal to 5.001
D. x is equal to 5.001
Answer» B. x is equal to 4
34.

Which value for x would make the following condition true: (x >= 5) And (x <= 6)

A. x is equal to 7
B. x is equal to 5
C. x is equal to 5.001
Answer» C. x is equal to 5.001
35.

Constructs in which an If block is contained inside another If block are called:

A. multi-if blocks
B. nested if blocks
C. sequential if blocks
D. none of the above
Answer» B. nested if blocks
36.

One may use an If block within a Select Case block.

A. true
B. false
Answer» A. true
37.

One may use a Select Case block within an If block.

A. true
B. false
Answer» A. true
38.

Select Case choices are determined by the value of an expression called a selector.

A. true
B. false
Answer» A. true
39.

Items in the value list must evaluate to a literal of the same type as the selector

A. true
B. false
Answer» A. true
40.

A single Case statement can contain multiple values.

A. true
B. false
Answer» A. true
41.

You can specify a range of values in a Case clause by using the To keyword.

A. true
B. false
Answer» A. true
42.

A variable declared inside a Select Case block cannot be referred to by code outside of the block.

A. true
B. false
Answer» A. true
43.

Suppose that the selector in a Select Case block is the string variable myVar. Which of the following is NOT a valid Case clause?

A. case “adams”
B. case “739”
C. case (myvar.substring(0, 1)
D. case myvar.length
Answer» D. case myvar.length
44.

Different items appearing in the same value list of a Select Case block must be separated by a ____________.

A. semi colon
B. comma
C. colon
D. pair of quotation marks
Answer» B. comma
45.

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
Answer» B. case 1 to 5, 8
46.

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
Answer» C. case is >= 7
47.

What type of items are valid for use in the value list of a Case clause?

A. literals
B. variables
C. expressions
D. all of the above
Answer» D. all of the above
48.

What happens to a variable declared locally inside a Sub procedure after the procedure terminates?

A. it maintains its value even after the end sub statement executes.
B. it ceases to exist after the end sub statement executes.
C. it loses its value temporarily after the end sub statement executes, but regains that value upon re-entry to the sub procedure.
D. it is reset to its default value.
Answer» B. it ceases to exist after the end sub statement executes.
49.

Suppose a variable is passed by reference 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 can?t 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.
Answer» A. it will have the newly modified value from inside the sub procedure.
50.

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 can?t 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.
Answer» C. it will retain the value it had before the call to the sub procedure
51.

The declaration statement for a class-level variable should be placed __________.

A. inside an event procedure
B. inside a general procedure
C. anywhere in the program region, except inside a procedure
D. above the statement public class frmname
Answer» C. anywhere in the program region, except inside a procedure
52.

Variables declared inside a procedure are said to have ________________.

A. local scope
B. procedure-level scope
C. class-level scope
D. none of the above
Answer» A. local scope
53.

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.
Answer» D. the two variables will be local to their respective sub procedures.
54.

Which of the following statements is guaranteed to pass the variable numVar by value to the Sub procedure Tally?

A. tally(numvar)
B. tally(byval numvar)
C. tally((numvar))
D. tally(byval numvar as double)
Answer» D. tally(byval numvar as double)
55.

The ______________ of a Sub procedure are vehicles for passing numbers and strings to the Sub procedure.

A. call statements
B. arguments
C. parameters
D. variables declared inside
Answer» C. parameters
56.

Which of the following is NOT a reason for using procedures?

A. they break a complex problem down into smaller pieces.
B. they make a program run faster.
C. they can be reused easily.
D. they make it possible for a team of people to work together on a single program.
Answer» B. they make a program run faster.
57.

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

A. arguments appear in call statements; parameters appear in sub statements.
B. parameters appear in call statements; arguments appear in sub statements.
C. they are synonymous terms.
D. they are completely unrelated in a program.
Answer» A. arguments appear in call statements; parameters appear in sub statements.
58.

Each individual variable in the list student(0), student(1), student(2) is known as a(n)

A. subscript
B. dimension
C. element
D. type
Answer» C. element
59.

The statement Const TAX_RATE As Doubleface=Calibri size=2> is not valid.

A. true
B. false
Answer» A. true
60.

Function names should be suggestive of the role performed. The names also must conform to the rules for naming variables.

A. true
B. false
Answer» A. true
61.

The input to a user-defined function can consist of one or more values.

A. true
B. false
Answer» A. true
62.

Both the input and output of a Function procedure can consist of several values.

A. true
B. false
Answer» B. false
63.

Suppose you want to write a procedure that takes three numbers, num1, num2, and num3; and returns their sum, product, and average. It is best to use a Function procedure for this task.

A. true
B. false
Answer» B. false
64.

Although a function can return a value, it cannot directly display information in a text box.

A. true
B. false
Answer» B. false
65.

Function procedures can invoke other Function procedures.

A. true
B. false
Answer» A. true
66.

A Function may return up to two values.

A. true
B. false
Answer» B. false
67.

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
Answer» D. all of the above
68.

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

A. values of the function
B. parameters
C. coordinates
D. arguments
Answer» B. parameters
69.

The arguments appearing in a Call 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
Answer» B. names of arguments
70.

A Do While loop checks the While condition before executing the statements in the loop.

A. true
B. false
Answer» A. true
71.

A Do?Loop Until block is always executed at least once

A. true
B. false
Answer» A. true
72.

A counter variable is normally incremented or decremented by 1.

A. true
B. false
Answer» A. true
73.

The value of the control variable should not be altered within the body of a For?Next loop.

A. true
B. false
Answer» B. false
74.

The body of a For…Next loop in Visual Basic will always be executed once no matter what the initial and terminating values are.

A. true
B. false
Answer» B. false
75.

The body of a For…Next loop in Visual Basic will always be executed once no matter what the initial and terminating values are. duplicate question?

A. true
B. false
Answer» B. false
Tags
Question and answers in Dot Net Architecture and Program, Dot Net Architecture and Program multiple choice questions and answers, Dot Net Architecture and Program Important MCQs, Solved MCQs for Dot Net Architecture and Program, Dot Net Architecture and Program MCQs with answers PDF download