Exam 6: Procedures and Functions

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

Which of the following examples correctly uses an input box to assign a value to an integer, and returns the integer to the calling program using a reference parameter?

Free
(Multiple Choice)
4.8/5
(40)
Correct Answer:
Verified

B

Which of the following can be returned by a function?

Free
(Multiple Choice)
4.9/5
(39)
Correct Answer:
Verified

D

When a parameter is declared using the ______qualifier, the procedure has access to the original argument variable and may make changes to its value.

Free
(Multiple Choice)
4.8/5
(37)
Correct Answer:
Verified

C

In the context of Visual Basic procedures and functions, what is an argument?

(Multiple Choice)
4.8/5
(39)

A procedure may not be accessed by procedures from another class or form if the ______access specifier is used.

(Multiple Choice)
5.0/5
(33)

What is the syntax error in the following procedure? Sub DisplayValue(Dim intNumber As Integer) MessageBox.Show(intNumber.ToString()) End Sub

(Multiple Choice)
4.9/5
(41)

All of the following are true about functions except __________.

(Multiple Choice)
4.9/5
(33)

Which of the following code examples is a function that will accept three integer parameters, calculate their average, and return the result?

(Multiple Choice)
4.9/5
(42)

Which of the following calls to the GetNumber procedure is not valid? Sub GetNumber(ByVal intNumber as Integer) ' (procedure body) End Sub

(Multiple Choice)
4.8/5
(45)

Which statement is true in regard to passing an argument by value to a procedure?

(Multiple Choice)
4.8/5
(44)

What is the value of intTotal after the following code executes? Dim intNumber1 As Integer = 2 Dim intNumber2 As Integer = 3 Dim intTotal As Integer IntTotal = AddSquares(intNumber1, intNumber2) Function AddSquares(ByVal intA As Integer, ByVal intB As Integer) As Integer IntA = intA * intA IntB = intB * intB Return intA + intB IntA = 0 IntB = 0 End Function

(Multiple Choice)
4.8/5
(39)

If you do not provide an access specifier for a procedure, it will be designated ______by default.

(Multiple Choice)
4.9/5
(35)

Which of the following functions accepts a parameter named dblSales and returns the commission to the calling statement? Assume that the commission should equal the sales multiplied by the commission rate. Use the following table as a guide to the calculation of the commission rate.

(Multiple Choice)
4.8/5
(28)

Which of the following procedure declarations matches the call to the IsLetter procedure below? Dim strText as String = txtInput.Text Dim blnLetter as Boolean = IsLetter(strText)

(Multiple Choice)
4.8/5
(33)

What is assigned to lblDisplay.Text when the following code executes? Dim intNumber As Integer = 4 AddOne(intNumber, 6) LblDisplay.Text = intNumber ' Code for AddOne Public Sub AddOne(ByVal intFirst As Integer, ByVal intSecond As Integer) IntFirst += 1 IntSecond += 1 End Sub

(Multiple Choice)
4.9/5
(26)

By writing your own procedures, you can ______an applications code, that is, break it into small, manageable procedures.

(Multiple Choice)
4.9/5
(36)

Choose a new, more descriptive name for the WhatIsIt function based on the result of the code below. Function WhatIsIt(ByVal intRepeat as Integer) as Integer Dim intResult as Integer = 1 Dim intCount as Integer For intCount = 1 to intRepeat IntResult = intResult * 2 Next intCount Return intResult End Function

(Multiple Choice)
4.9/5
(37)

When calling a procedure, passed arguments and declared parameters must agree in all of the following ways except __________.

(Multiple Choice)
4.8/5
(29)

Which debugging command executes a function call without stepping through function's statements?

(Multiple Choice)
4.9/5
(40)

A is a special variable that receives a value being passed into a procedure or function.

(Multiple Choice)
4.8/5
(49)
Showing 1 - 20 of 31
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)