Exam 6: Procedures and Functions

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

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

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

D

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

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

C

When debugging a program in break mode, the Step Into command causes the currently highlighted line of code to execute.

Free
(True/False)
4.9/5
(36)
Correct Answer:
Verified

True

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

(Multiple Choice)
4.8/5
(34)

When a procedure finishes execution, .

(Multiple Choice)
4.7/5
(40)

All of the following are true about functions except .

(Multiple Choice)
4.9/5
(31)

Choose a new, more descriptive name for the WhatIsIt function based on the result of the code below. Function WhatIsItByVal 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
(35)

What will be the value of dblSum after the button btnAdd is clicked, assuming that 25 is entered by the user into txtNum1, and 35 is entered into txtNum2? Private Sub btnAdd_ClickByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles btnAdd.Click Dim dblNum1, dblNum2, dblSum As Double DblNum1 = CDbltxtNum1.Text) DblNum2 = CDbltxtNum2.Text) DblSum = SumdblNum1, dblNum2) LblSum.Text = dblSum.ToString) End Sub Function SumByVal dblNum1 As Double, ByVal dblNum2 As Double) as Double Return dblNum1 + dblNum2 End Function

(Multiple Choice)
4.7/5
(41)

Which of the following does not apply to procedures and functions?

(Multiple Choice)
4.8/5
(37)

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

(Multiple Choice)
5.0/5
(28)

Which is the correct way to define a function named Square that receives an integer and returns an integer representing the square of the input value?

(Multiple Choice)
4.7/5
(38)

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

(Multiple Choice)
4.8/5
(44)

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

(Multiple Choice)
4.7/5
(35)

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

(Multiple Choice)
4.7/5
(43)

Which of the following procedures will keep track of the number of times it was called?

(Multiple Choice)
4.9/5
(40)

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.9/5
(33)

Although you can omit the ByVal keyword in a parameter variable declaration, it is still a good idea to use it.

(True/False)
4.9/5
(45)

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

(Multiple Choice)
4.9/5
(39)

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

(Multiple Choice)
4.9/5
(34)

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 = AddSquaresintNumber1, intNumber2) Function AddSquaresByVal 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
(48)
Showing 1 - 20 of 31
close modal

Filters

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