Programming with Microsoft Visual Basic 2017
8th Edition
ISBN: 9781337102124
Author: Diane Zak
Publisher: Cengage Learning
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Chapter 6, Problem 16RQ
Program Description Answer
The statement decDiscount = GetDiscount(decSales, decRate) is used to invoke the function by passing the decSales and dexRate decimal variables and assign the function’s return value into the decDiscount variable.
Hence, the correct answer is option “C”.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
You 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
from math.sqrt as squareRoot
import sqrt from math as squareRoot
from math import sqrt as squareRoot
import math.sqrt as squareRoot
You 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 squareRoot
The following statements call a function named show_data. Which of the statements passes arguments by position, and which passes keyword arguments?a. show_data(name='Kathryn', age=25)b. show_data('Kathryn', 25)
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
Similar questions
- The value of a global constant can only be changed within a function. True or falsearrow_forwardFor each of the following functions, indicate how much the function’s value will change it its argument is increased Triple. 3Narrow_forwardWrite a header for a function named getKey. The function should return a char and use no parameters.arrow_forward
- When you try to access to a local variable outside the function an error is generatedSelect one:a. Falseb. Truearrow_forwardDo not use any global variable. Properly send arguments to functions and use their return valuesarrow_forwardWhich of the following functions correctly returns the argument value times 10? new timesTen(num) { var result = num * 10; return result;} timesTen(num) { var result == num * 10; return result;} function timesTen(num) { var result == num; return result;} function timesTen(num) { var result = num * 10; return result;}arrow_forward
- Select the statements that apply to local variables. Only statements within subroutine can view or modify local variables. Storage used by local variables is released when subroutine ends. Local variable name cannot have the same name as a local variable in another function.arrow_forwardIn physics, an object that is in motion is said to have kinetic energy. The following formula can be used to determine a moving object’s kinetic energy:KE=12mv2The variables in the formula are as follows: KE is the kinetic energy, m is the object’s mass in kilograms, and v is the object’s velocity in meters per second. Write a function named kinetic_energy that accepts an object’s mass (in kilograms) and velocity (in meters per second) as arguments. The function should return the amount of kinetic energy that the object has. Write a program that asks the user to enter values for mass andvelocity, then calls the kinetic_energy function to get the object’s kinetic energy.arrow_forwardWrite 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_forward
- calculate.py Write five value-returned functions that performs the mathematical operations: add, subtract, divide, multiply and average. Within the main read two decimal numbers from the user and call all the five functions.arrow_forwardQuestion 29 4 pts Write a Racket function, bmi, that will accept 2 parameters to calculate your body mass index: weight (in pounds) height (in inches) weight 703 height The formula is: bmi Edit Format Tablearrow_forwardWhen the GetExpenses function completes its processing, it should send the value stored in the decTotal variable to the statement that invoked the function. Which of the following statements accomplishes this task?a. Return (ByVal decTotal)b. Send ByVal(decTotal)c. SendBack decTotald. Return decTotalarrow_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 LearningLINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.Computer ScienceISBN:9781337569798Author:ECKERTPublisher:CENGAGE LNp Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:Cengage
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
LINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.
Computer Science
ISBN:9781337569798
Author:ECKERT
Publisher:CENGAGE L
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage