Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Determine the output displayed when the button is clicked. Private Sub btnDispla

ID: 3630774 • Letter: D

Question

Determine the output displayed when the button is clicked.

Private Sub btnDisplay_Click(...) Handles btnDisplay.Click
Dim price, markdown, salesTax, finalCost as Double
InputData(price, finalCost)
finalCost = CostOfItem(price, markdown, salesTax)
DisplayOutput(price, finalCost)
End Sub
Sub InputData (ByRef price As Double, ByRef markdown As Double, ByRef salesTax As Double)
Price = CDbl(InputBox(“Price of item: “)
Markdown = CDbl (InputBox(“Percentage discount: “))
salesTax = CDbl(InputBox(“Percentage state sales tax: “))
End Sub
Function CostOfItem(ByVal pr As Double, ByVal md As Double, ByVal st As Double) As Double
Dim reducedPrice, cost As Double
reducedPrice = pr – ((md/100) * pr)
cost = reducedPrice + ((st / 100) * reducedPrice)
Return cost
End Function
(Assume the three responses are 125, 20, and 6)

Explanation / Answer

Private Sub btnDisplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplay.Click

Dim price, markdown, salesTax, finalCost As Double

InputData(price, finalCost, salesTax)

finalCost = CostOfItem(price, markdown, salesTax)

DisplayOutput(price, finalCost)

End Sub

Sub InputData(ByRef price As Double, ByRef markdown As Double, ByRef salesTax As Double)

price = CDbl(InputBox("Price of item: "))

Markdown = CDbl(InputBox("Percentage discount: "))

salesTax = CDbl(InputBox("Percentage state sales tax: "))

End Sub

Function CostOfItem(ByVal pr As Double, ByVal md As Double, ByVal st As Double) As Double

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote