Chapter 8: Using Procedures and Exception Handling
MULTIPLE CHOICE
a. |
startup |
c. |
title |
b. |
flash |
d. |
splash |
ANS: D PTS: 1 REF: 554
a. |
BackGround |
c. |
BackgroundImage |
b. |
BackImage |
d. |
BackGroundPicture |
ANS: C PTS: 1 REF: 555
a. |
properties |
c. |
resources |
b. |
settings |
d. |
all of the above |
ANS: D PTS: 1 REF: 557
a. |
Manager |
c. |
Designer |
b. |
Control |
d. |
Application |
ANS: C PTS: 1 REF: 557
a. |
Assembly |
c. |
Activity |
b. |
ActiveX |
d. |
Argument |
ANS: A PTS: 1 REF: 558
a. |
Stop |
c. |
Wait |
b. |
Pause |
d. |
Sleep |
ANS: D PTS: 1 REF: 560
a. |
Suspend |
c. |
Pause |
b. |
Sleep |
d. |
Halt |
ANS: B PTS: 1 REF: 560
a. |
cmb |
c. |
cbx |
b. |
cbo |
d. |
cmo |
ANS: B PTS: 1 REF: 562
a. |
-1 |
c. |
1 |
b. |
0 |
d. |
2 |
ANS: B PTS: 1 REF: 564
a. |
-1 |
c. |
1 |
b. |
0 |
d. |
null |
ANS: B PTS: 1 REF: 564
a. |
SelectedIndex |
c. |
SelectedIndexChanged |
b. |
IndexChanged |
d. |
ChangedSelectedIndex |
ANS: C PTS: 1 REF: 566
a. |
SelectedIndexChanged |
c. |
NewSelection |
b. |
SelectionAdjusted |
d. |
NewIndex |
ANS: A PTS: 1 REF: 566
a. |
parameter |
c. |
argument |
b. |
procedure |
d. |
index |
ANS: B PTS: 1 REF: 567
a. |
invocation |
c. |
call |
b. |
cast |
d. |
metric |
ANS: C PTS: 1 REF: 567
a. |
Private |
c. |
Function |
b. |
Sub |
d. |
Public |
ANS: B PTS: 1 REF: 567
a. |
0 |
c. |
2 |
b. |
1 |
d. |
3 |
ANS: A PTS: 1 REF: 567
a. |
1 |
c. |
3 |
b. |
2 |
d. |
4 |
ANS: B PTS: 1 REF: 569
a. |
braces |
c. |
brackets |
b. |
parentheses |
d. |
quotation marks |
ANS: B PTS: 1 REF: 570
a. |
parameter |
c. |
index |
b. |
sub |
d. |
argument |
ANS: D PTS: 1 REF: 570
a. |
ByRef |
c. |
ByVal |
b. |
ByHand |
d. |
ByVar |
ANS: C PTS: 1 REF: 571
a. |
ByRef |
c. |
ByVal |
b. |
ByHand |
d. |
ByVar |
ANS: A PTS: 1 REF: 573
a. |
Form |
c. |
Function |
b. |
Sub |
d. |
Splash |
ANS: C PTS: 1 REF: 575
a. |
cannot accept any |
c. |
can accept two |
b. |
can accept one |
d. |
can accept any number of |
ANS: D PTS: 1 REF: 575
a. |
0 |
c. |
2 |
b. |
1 |
d. |
3 |
ANS: B PTS: 1 REF: 576
a. |
SendVal |
c. |
ReturnVal |
b. |
Return |
d. |
ReturnValue |
ANS: B PTS: 1 REF: 576
a. |
Value |
c. |
Return |
b. |
Sub |
d. |
Function |
ANS: D PTS: 1 REF: 576
a. |
Return |
c. |
Send |
b. |
Sub |
d. |
Deliver |
ANS: A PTS: 1 REF: 576
a. |
block |
c. |
global |
b. |
local |
d. |
class |
ANS: D PTS: 1 REF: 578
a. |
ByVal |
c. |
ByRef |
b. |
BySub |
d. |
ByArg |
ANS: C PTS: 1 REF: 578
a. |
Try-Catch |
c. |
Catch-Error |
b. |
Try-Code |
d. |
Try-CatchError |
ANS: A PTS: 1 REF: 579
a. |
Contained |
c. |
Inner |
b. |
Private |
d. |
Distinct |
ANS: B PTS: 1 REF: 579
a. |
NullReferenceException |
c. |
OverflowException |
b. |
ArgumentNullException |
d. |
SystemException |
ANS: B PTS: 1 REF: 580
a. |
DivisionError |
c. |
DivideByZeroException |
b. |
ZeroError |
d. |
ZeroDivisionError |
ANS: C PTS: 1 REF: 580
a. |
TypeException |
c. |
FormatMismatchException |
b. |
TypeMismatchException |
d. |
FormatException |
ANS: D PTS: 1 REF: 580
a. |
NullReferenceException |
c. |
OverflowException |
b. |
ArgumentNullException |
d. |
SystemException |
ANS: C PTS: 1 REF: 580
a. |
NullReferenceException |
c. |
OverflowException |
b. |
ArgumentNullException |
d. |
SystemException |
ANS: D PTS: 1 REF: 580
a. |
Terminate |
c. |
End Try |
b. |
Conclude |
d. |
Quit Catch |
ANS: C PTS: 1 REF: 580
a. |
NullReferenceException |
c. |
OverflowException |
b. |
ArgumentNullException |
d. |
SystemException |
ANS: A PTS: 1 REF: 580
a. |
cannot contain any |
c. |
can contain two |
b. |
can contain one |
d. |
can contain any number of |
ANS: D PTS: 1 REF: 581
a. |
Else |
c. |
Catch |
b. |
Finally |
d. |
Next |
ANS: B PTS: 1 REF: 582
MULTIPLE RESPONSE
Modified Multiple Choice
a. |
program title |
c. |
file version |
b. |
company name |
d. |
Sub procedure |
ANS: A, B, C PTS: 1 REF: 558
a. |
ComboBox |
c. |
SelectionBox |
b. |
DropDownList |
d. |
ListBox |
ANS: A, B, D PTS: 1 REF: 566
a. |
Integrated |
c. |
Sub |
b. |
Master |
d. |
Function |
ANS: C, D PTS: 1 REF: 567
a. |
the title of the program |
c. |
the master variable |
b. |
the procedure name |
d. |
a set of parentheses |
ANS: B, D PTS: 1 REF: 567
a. |
TextException |
c. |
OverflowException |
b. |
DivideByZeroException |
d. |
FormatException |
ANS: B, C, D PTS: 1 REF: 580
MODIFIED TRUE/FALSE
ANS: F, Sleep
PTS: 1 REF: 560
ANS: T PTS: 1 REF: 561
ANS: F, can
PTS: 1 REF: 561
ANS: F, Text
PTS: 1 REF: 563
ANS: F, Items
PTS: 1 REF: 563
TRUE/FALSE
ANS: F PTS: 1 REF: 564
ANS: F PTS: 1 REF: 565
ANS: F PTS: 1 REF: 567
ANS: F PTS: 1 REF: 567
ANS: T PTS: 1 REF: 567
ANS: F PTS: 1 REF: 569
ANS: T PTS: 1 REF: 569
ANS: T PTS: 1 REF: 573
ANS: F PTS: 1 REF: 573
ANS: T PTS: 1 REF: 574
ANS: F PTS: 1 REF: 575
ANS: T PTS: 1 REF: 575
ANS: F PTS: 1 REF: 575
ANS: F PTS: 1 REF: 575
ANS: T PTS: 1 REF: 575
ANS: T PTS: 1 REF: 575
ANS: F PTS: 1 REF: 575
ANS: T PTS: 1 REF: 575
ANS: F PTS: 1 REF: 576
ANS: T PTS: 1 REF: 576
ANS: T PTS: 1 REF: 580
ANS: T PTS: 1 REF: 580
ANS: F PTS: 1 REF: 580
ANS: T PTS: 1 REF: 581
ANS: F PTS: 1 REF: 582
COMPLETION
ANS: splash
PTS: 1 REF: 554
ANS: BackgroundImage
PTS: 1 REF: 555
ANS: ComboBox
PTS: 1 REF: 562
ANS: SelectedIndex
PTS: 1 REF: 564
ANS: SelectedItem
PTS: 1 REF: 564
ANS: Sub
PTS: 1 REF: 567
ANS: ByVal
PTS: 1 REF: 571
ANS:
ByVal
by value
PTS: 1 REF: 573
ANS:
ByRef
by reference
PTS: 1 REF: 573
ANS: Function
PTS: 1 REF: 575
ANS: return
PTS: 1 REF: 575
ANS:
Try-Catch
Try Catch
PTS: 1 REF: 579
ANS: Try
PTS: 1 REF: 579
ANS: Catch
PTS: 1 REF: 579
ANS: ArgumentNullException
PTS: 1 REF: 580
ANS: NullReferenceException
PTS: 1 REF: 580
ANS: OverflowException
PTS: 1 REF: 580
ANS: SystemException
PTS: 1 REF: 580
ANS: FormatException
PTS: 1 REF: 580
ANS: DivideByZeroException
PTS: 1 REF: 580
MATCHING
Identify the letter of the choice that best matches the phrase or definition.
a. |
template |
f. |
ListBox |
b. |
Project Designer |
g. |
Sub procedure |
c. |
SelectedIndex |
h. |
Private |
d. |
SelectedIndexChanged |
i. |
procedure call |
e. |
procedure |
j. |
Select Case |
ESSAY
ANS:
A Sub procedure is a procedure that completes its task but does not return any data to the calling procedure. A Sub procedure in Visual Basic 2010 is defined by using the Sub keyword. A Sub procedure is the series of Visual Basic statements enclosed by the Sub and End Sub statements. Each time the Sub procedure is called, its statements are executed, starting with the first executable statement after the Sub statement and ending with the first End Sub statement. A Sub procedure is called with a statement consisting of the procedure name and a set of parentheses in the form of a procedure call.
PTS: 1 REF: 567 TOP: Critical Thinking
ANS:
A Function procedure is similar to a Sub procedure except that a Function procedure returns a single value to the calling procedure. Just like a Sub procedure, you can pass variables to the Function procedure using ByVal and ByRef. A Function procedure uses the keyword Function (instead of the keyword Sub) in the procedure declaration. You also must specify a return data type in the procedure declaration to define the type of variable that is being returned to the calling procedure by the Function procedure.
PTS: 1 REF: 575 TOP: Critical Thinking
ANS:
This is useful when you want to state which type of error occurred, identifying to users the particular mistake that was made. It is best to order exceptions in Catch blocks from the most specific to the least specific. In other words, place the Catch block that is most likely to be needed for the most common exception first in a series of Catch statements. If an exception occurs during the execution of the Try block, Visual Basic examines each Catch statement within the Try-Catch block until it finds one whose condition matches that error. If a match is found, control transfers to the first line of code in the Catch block. If no matching Catch statement is found, the search proceeds to the next Catch statement in the Try-Catch block. This process continues through the entire code block until a matching Catch block is found in the current procedure. If no match is found, an exception that stops the program is produced.
PTS: 1 REF: 581 TOP: Critical Thinking
CASE
Critical Thinking Questions
Case 8-1
Of all of the concepts Sheila has learned so far, she is having the hardest time understanding the use of procedures, including when and how to use them. She asks her instructor for some additional clarification.
a. The Sub procedure should perform a single, defined task. |
c. A Function procedure must perform reasonably substantial processing. |
b. Procedures that perform multiple tasks tend to become large and difficult to design and code. |
d. It is good practice to place a procedure call statement in a calling procedure and have the called procedure contain one or two program statements. |
ANS:
D.
PTS: 1 REF: 585 TOP: Critical Thinking
a. Will the program be easier to read if the code is placed in a separate procedure? |
c. Does this task require more than eight or nine programming statements? |
b. Does the proposed code perform a single task? |
d. Can the Sub procedure or Function procedure perform its processing by receiving data as arguments, and by returning data either using the Return statement or by using ByRef arguments? |
ANS:
C.
PTS: 1 REF: 585 TOP: Critical Thinking
Critical Thinking Questions
Case 8-2
Your colleague hasn’t used Visual Basic in a while and so when he encounters a decision point, he sometimes calls out to you over the cubicle wall to get answers to his questions.
a. ByVal |
c. ByArg |
b. ByRef |
d. ByInd |
ANS:
A.
PTS: 1 REF: 571 TOP: Critical Thinking
a. ByVal |
c. ByArg |
b. ByRef |
d. ByInd |
ANS:
B.
PTS: 1 REF: 573 TOP: Critical Thinking
hihi
To export a reference to this article please select a referencing stye below.
Assignment Hippo (2022) . Retrive from https://assignmenthippo.com/sample-assignment/using-procedures-and-exception-handling-mcqs
"." Assignment Hippo ,2022, https://assignmenthippo.com/sample-assignment/using-procedures-and-exception-handling-mcqs
Assignment Hippo (2022) . Available from: https://assignmenthippo.com/sample-assignment/using-procedures-and-exception-handling-mcqs
[Accessed 20/08/2022].
Assignment Hippo . ''(Assignment Hippo,2022) https://assignmenthippo.com/sample-assignment/using-procedures-and-exception-handling-mcqs accessed 20/08/2022.
Want to order fresh copy of the Sample Template Answers? online or do you need the old solutions for Sample Template, contact our customer support or talk to us to get the answers of it.
Our motto is deliver assignment on Time. Our Expert writers deliver quality assignments to the students.
Get reliable and unique assignments by using our 100% plagiarism-free.
Get connected 24*7 with our Live Chat support executives to receive instant solutions for your assignment.
Get Help with all the subjects like: Programming, Accounting, Finance, Engineering, Law and Marketing.
Get premium service at a pocket-friendly rate at AssignmentHippo
I was struggling so hard to complete my marketing assignment on brand development when I decided to finally reach to the experts of this portal. They certainly deliver perfect consistency and the desired format. The content prepared by the experts of this platform was simply amazing. I definitely owe my grades to them.
Get instant assignment help