Exam 7: Sub and Function Procedures

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

Case-Based Critical Thinking Questions Case 1 - MTN Outdoor You have just started working for MTN Outdoor as a programmer. Your first assignment is to review and correct various code to use sub procedures and/or functions. Which of the following statements would invoke the GetEndInventory function and assign the function's return value to the intEnd variable?

(Multiple Choice)
4.9/5
(31)

Like the first item in a list box, the first item in a combo box has an index of ____.

(Multiple Choice)
4.8/5
(34)

A(n) ____ is processed only when it is called (invoked) from code.

(Multiple Choice)
4.9/5
(31)

Write the code for a Sub procedure named CalculateBonus . The procedure receives three decimal variables representing the salary, bonus rate, and bonus amount. The procedure should calculate the bonus amount by multiplying the salary by the bonus rate. Create your own variable names.

(Essay)
5.0/5
(40)

In a ____ combo box, the text portion is not editable.

(Multiple Choice)
4.8/5
(29)

Write the code for a function named CalculateBonus . The function receives two decimal variables representing the salary and bonus rate. The function should calculate the bonus amount by multiplying the salary by the bonus rate, and then return the result. Then write the appropriate statement to invoke the function, passing it the decSalary and decRate variables. Assign the function's return value to the decBonus variable.

(Essay)
4.8/5
(35)

When using ____, you capitalize the first letter in the procedure name and the first letter of each subsequent word in the name.

(Multiple Choice)
4.8/5
(29)

Write the code for a Sub procedure named DisplayAuto , which displays a message containing the two values passed to it: an automobile make and model. Use strMake and strModel as the parameters. Display the "You own a make model ." message in a message box. Then write the statement to invoke the procedure, passing it the contents of the strBrand and strType variables, respectively.

(Essay)
4.9/5
(39)

What is the Math.Round function? Provide the function's syntax and define the arguments.

(Essay)
4.7/5
(26)

How do the parameterList of a procedure header and the argumentList of a Call statement relate to each other?

(Essay)
4.9/5
(36)

For the access key to work correctly in a combo box, you must set the label's TabIndex property to a value that is ____ the combo box's TabIndex value.

(Multiple Choice)
4.9/5
(36)

When will the TextChanged event occur for a combo box? Which style allows the user to edit the text of the combo box?

(Essay)
4.9/5
(30)

Which of the following is a valid Return statement?

(Multiple Choice)
4.9/5
(35)

Write the code to add Freshman, Sophomore, Junior, and Senior to the Class combo box. Use the SelectedItem property to make Freshman the default item.

(Essay)
4.8/5
(40)

The names of the arguments in a Call statement need to be identical to the names of the corresponding parameters.

(True/False)
4.8/5
(34)

The default combo box style in Visual Basic is ____.

(Multiple Choice)
4.7/5
(35)

Write the code for a Sub procedure named InitializeVariables . The Sub procedure will assign the number 0 to the intTotalCars , intTotalTrucks , intTotalSUVs . Then write the code to call the procedure.

(Essay)
4.9/5
(38)

A form's ____ procedure is responsible for verifying that the user wants to close the application, and then taking the appropriate action based on the user's response.

(Multiple Choice)
4.8/5
(42)

An independent Sub procedure can contain one or more ____ in its procedure header that have procedure scope and store an item of data.

(Multiple Choice)
4.9/5
(37)

Which of the following statements would invoke the DisplayMessage Sub procedure?

(Multiple Choice)
4.7/5
(42)
Showing 41 - 60 of 60
close modal

Filters

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