In every exercise determine the output displayed when the button is clicked (Che
ID: 3703089 • Letter: I
Question
In every exercise determine the output displayed when the button is clicked (Check the assumptions when listed at the end of the exercise) Private Sub btnDisplay Click..) Handles btnDisplay Click Dim price markdown, salesTax. finalCost As Decimal finalCost - osftem(prearkdown, salesTaxi Display utputiprice, finalCost) End Sub Sub InputData(ByRef price As Decima ByRef markdown As Decimal. By:Ref sal Tax As Decimal) price CDec InputBox( Prceofitem:")) markdown-CDeclinputBoo-percentage discount salesTax CDec(InputBox("Percentage state sales tax")) End Sub Function Costofitemipr As Decimal md As Decimal st As Decimal) As Decimal reducedPrice-pr ((md /100)pr) cost = reducedPrice + ((st / 100) * reducedPrice) Return cost End Sub Sub Displayutput(amount As Decimal customerCost As Decimal) C) IstoutputItems Add Cost: &customerCost; ToString End Sub (Assume the thre responses are, 125, 20, and 6.) Private Su btnCalclate Clickl) Handles btnCalculate Click Dim wholesaleCost salePrice percentCommission, salesTa profit As Decimal InputDataiwholesaleCost salePrice. percentCommission) CalculateSomeValueswholesaleCost salePrice percentCommission salesTas profit) DisplayDatalsalax Rrofit) End Sub Sub InputData(ByRef wholesaleCost As Decimal. ByRef salePrice As ByRef As Decimal wholesaleCost 100 salePrig? = 300 percentCommission5 End Sub Sub CalculateSomeValues(wholesaleCost As Decimal salePrice As Decimal. percentCommission As Decimal. ByRef salesTax As Decimal. ByRef proft As Decimal) salesTax0.06DsalePrice profitsalePrice - wholesaleCost - salePric (percentCommissien 100) Sub DisplayDatatsalesTax As Decimal, profit As Decimal) stOutputltems Add sales taxsalesTax.ToString C) stoutoutltemsAddr ofit & profit ToStringC) End SubExplanation / Answer
6.
Given input , price=125
markdown=20
salesTax=6
From btnDisplay click method, the first
called is InputData, then second called CostOfItem
and then called DisplayOutput
InputData is read price,markdown and sales tax values
as 125 , 20 and 6 as input from user
First CostOfItem is called
reducedPrice= 125-(20/100)*125
reducedPrice= 125-25=100
cost=reducedPrice-(6/100)*25
cost= 100-1.5=98.5
DisplayOutput prints Original Price : $125
Cost $98.5
-----------------------------------------------------------------------------
8.
btnCalculate calls the methods InputData , CalculateSomeValues
DisplayData methods
InputData set values
wholesaleCost=100
salePrice=300
percentCommission=5
CalculateSomeValues method
salesTax= 0.06 *300=18
profit=300-100-300*(5/100)
profit=300-100-15
profit=300-115=185
DisplayData method display
sales tax $18.00
profit : $185