Ask Question
2 January, 00:06

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)

+3
Answers (1)
  1. 2 January, 03:30
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers