Ask Question
7 April, 11:26

An application needs to calculate sales tax for purchases. You decide to simplify the code by putting the sales tax calculation in a function. The returned value from the function is then added to the Subtotal, and the result is stored in the decTotal variable. Which of the following statements will call the GetSalesTax function and return a value to be used in the Total calculation? a.) decTotal = decSubtotal + GetSalesTax () b.) decSubtotal + GetSalesTax (decSubtotal) c.) decTotal = decSubtotal + GetSalesTax (decSubtotal) d.) decTotal = decSubtotal + GetSalesTax (decSubtotal As Decimal)

+2
Answers (1)
  1. 7 April, 11:57
    0
    Option C: decTotal = decSubtotal + GetSalesTax (decSubtotal)

    Explanation:

    To get sales tax, we need a function can process a subtotal amount and return the tax values. By presuming GetSalesTax () is a function that will return a tax value, this function will expect decSubtotal as the input parameter to the function. Otherwise, there will be no values processed in the function.

    The statement decTotal = decSubtotal + GetSalesTax (decSubtotal) will invoke function GetSalesTax () by passing decSubtotal as argument. Next the return value of the function will be added with decSubtotal and the summation amount assigned to the variable decTotal.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “An application needs to calculate sales tax for purchases. You decide to simplify the code by putting the sales tax calculation in a ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers