Programming with Microsoft Visual Basic 2017
8th Edition
ISBN: 9781337102124
Author: Diane Zak
Publisher: Cengage Learning
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 6, Problem 11RQ
Which of the following is a valid header for a procedure that is passed the number 15?
- a. Private Function GetTax(ByVal intRate As Integer) As Decimal
- b. Private Function GetTax(ByAdd intRate As Integer) As Decimal
- c. Private Sub CalcTax(ByVal intRate As Integer)
- d. Both a and c.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Which of the following is false?
a. The position of the arguments listed in the Call statement should agree with the position of the parameters listed in the receiving procedure’s parameterList.
b. The data type of each argument in the Call statement should match the data type of its corresponding parameter in the receiving procedure’s parameterList.c. The name of each argument in the Call statement should be identical to the name of its corresponding parameter in the receiving procedure’s parameterList.
d. When you pass information to a procedure by value, the procedure stores the value of each item it receives in a separate memory location.
A function named GetPayed receives a Double value and returns a Double value. Write the function header, using dblcharged as the parameter name.
Which of the following is false? a. When you pass a variable by reference, the receiving procedure can change its contents. b. To pass a variable by reference, you include the ByRef keyword before the variable’s name in the calling statement. c. When you pass a variable by value, the receiving procedure creates a procedure-level variable to store the value passed to it. d. When you pass a variable by value, the receiving procedure cannot change its contents.
Chapter 6 Solutions
Programming with Microsoft Visual Basic 2017
Ch. 6 - Prob. 1RQCh. 6 - Prob. 2RQCh. 6 - Prob. 3RQCh. 6 - Prob. 6RQCh. 6 - Prob. 7RQCh. 6 - Prob. 8RQCh. 6 - Which of the following instructs a function to...Ch. 6 - Prob. 10RQCh. 6 - Which of the following is a valid header for a...Ch. 6 - Prob. 14RQ
Ch. 6 - The memory locations listed in a procedure...Ch. 6 - Prob. 16RQCh. 6 - Prob. 17RQCh. 6 - The items in a combo box belong to which...Ch. 6 - Prob. 19RQCh. 6 - Prob. 20RQCh. 6 - Prob. 21RQCh. 6 - Prob. 22RQCh. 6 - Prob. 23RQCh. 6 - Prob. 24RQCh. 6 - Prob. 25RQCh. 6 - Prob. 1ECh. 6 - Prob. 3ECh. 6 - The Donut Shoppe sells four varieties of...Ch. 6 - Prob. 8ECh. 6 - Prob. 11E
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Which of the following is false?a. A function can receive information either by value or by reference.b. When a function ends, any variables listed in the function’s parameterList can be used by the statement that invoked the function.c. The variables listed in a function’s parameterList have procedure scope.d. A function uses the Return statement to return a value to the statement that invoked it.arrow_forwardWhich of the following headers indicates that the procedure returns a Decimal number?a. Private Function Calc() As Decimalb. Private Sub Calc() As Decimalc. Private Function Calc(Decimal)d. both a and barrow_forwardWhich of the following is false? a. A Sub procedure can accept items passed either by value or by reference. b. The parameterList in a procedure header is optional. c. At times, a memory location inside the computer’s internal memory may have more than one name. d. A Call statement must contain at least one argument.arrow_forward
- Write a function called music_genre that consumes an int representing a year and returns a string describing a music genre from that decade. Use the chart below: Range of Years Music Genre 1940-1949 Jazz 1950-1959 Rock 1960-1969 Motown 1970-1979 Disco 1980-1989 Pop 1990-1999 Alternativearrow_forwardWhich of the following function headers is correct? A. def afunction(a1 = 1, a2): B. def afunction(a1 = 1, a2, a3 = 3): C. def afunction(a1 = 1, a2 = 2, a3 = 3): A A,B C None is correct.arrow_forwardA function named GetEnding is passed three Integer variables named intBegin, intSales, and intPurchases. The function’s task is to calculate and return the ending inventory. Which of the following function headers is appropriate?a. Private Function GetEnding(ByVal intB As Integer, ByVal intS As Integer, ByVal intP As Integer) As Integerb. Private Function GetEnding(ByRef intB As Integer, ByRef intS As Integer, ByRef intP As Integer) As Integerc. Private Function GetEnding(ByVal intB As Integer, ByVal intS As Integer, ByVal intP As Integer, ByRef intE As Integer) As Integerd. Private Sub Function GetEnding(ByVal intB As Integer, ByVal intS As Integer, ByVal intP As Integer)arrow_forward
- Write a header for a function named getKey. The function should return a char and use no parameters.arrow_forwardYou are writing an application that uses the sqrt function. The program must reference the function using the name squareRoot.You need to import the function.Which code segment should you use? Group of answer choices D. from math.sqrt as squareRoot A. import math.sqrt as squareRoot B. import sqrt from math as squareRoot C. from math import sqrt as squareRootarrow_forwardprintTodaysDate is a function that accepts no parameters and returns no value. Write a statement that calls printTodaysDate.arrow_forward
- 4. Which one of the following creates a local variable? Declaring it inside a function without the var keyword Declaring it outside of a function with the var keyword Declaring it inside a function with the var keyword Declaring it outside of a function without the var keywordarrow_forwardWhich of the following is a valid header for a procedure that is passed the number 15? a. Private Function GetTax(ByVal intRate As Integer) As Decimal b. Private Function GetTax(ByAdd intRate As Integer) As Decimal c. Private Sub CalcTax(ByVal intRate As Integer) d. Both a and c.arrow_forward/ create the following functions: GetInteger - returns an integer DONE GetDouble - returns a double CheckInteger (called from GetInteger) - checks the range of an integer CheckDouble(called from GetDouble) - checks the range of a doubleCalculateSum - overloaded for integers and doubles as parameters DONE CalculateProduct - overloaded for integers and doubles as parameters DONE ShowSums - shows the sums of integers and the sum of doubles ShowProducts - shows the products of integers and the product of doubles. if you can create a function ShowInstructions that passes the type (integer or double) as a string. ShowInstructionsIntegers and ShowInstructionsDoublesarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Linux - Tutorial for Beginners in 13 MINUTES! [ UPDATED ]; Author: bai;https://www.youtube.com/watch?v=BMGixkvJ-6w;License: Standard YouTube License, CC-BY
What is Linux?; Author: Techquickie;https://www.youtube.com/watch?v=zA3vmx0GaO8;License: Standard YouTube License, CC-BY
Introduction to Linux and Basic Linux Commands for Beginners; Author: sakitech;https://www.youtube.com/watch?v=IVquJh3DXUA;License: Standard Youtube License