

McqMate
These multiple-choice questions (MCQs) are designed to enhance your knowledge and understanding in the following areas: Bachelor of Science in Computer Science TY (BSc CS) , Bachelor of Science in Computer Science (BSc CS) , Programming Languages .
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 |
Done Studing? Take A Test.
Great job completing your study session! Now it's time to put your knowledge to the test. Challenge yourself, see how much you've learned, and identify areas for improvement. Don’t worry, this is all part of the journey to mastery. Ready for the next step? Take a quiz to solidify what you've just studied.