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

visual basic help 1. Four labels to display ..Store I.\", \"Store 2:”·\"Store 3.

ID: 674503 • Letter: V

Question

visual basic help

1. Four labels to display ..Store I.", "Store 2:”·"Store 3." and "Company." and another four labels to display the total payroll for each of three stores and the total company payroll. (4 points) 2. A group box with the name "Payroll amounts" which groups the eight labels as shown in above figure. (2 points) 3. Two buttons with correct text. (2 points) 4. When the user clicks the "Calculate" button your application should pop up an input dialog box to get a payroll amount. Continue this until the user enters five payroll amounts for each of three stores. At the end, the total payroll for each of three stores and the total company payroll should display in corresponding labels. For this part the points will be assigned according to the following criteria. Get user input for five payroll amounts for each of three stores using the InputBox function. (10 points) a. The InputBox should display the payroll number and the store number as follows. Kenton Project Enter payrol 1 for store #1 OK Cancel b. Calculate the total payroll for each of three stores. (15 points) c. Calculate the total company payroll. (5 points) d. Display the calculated total payroll values on labels with a dollar sign and two decimal places. (10 points) The whole application should terminate and exit when user clicks the "Exit" button. (2 points) 5.

Explanation / Answer

CODE : // For entire solution

Private Sub calculateButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles calculateButton.Click
'displays each store's total payroll and the total company payroll

Dim inputPayroll As String
Dim payrollAmount As Decimal
Dim storeAccumulator As Double
Dim companyAccumulator As Double

'clear the storeLabel and companyLabel

store1Label.Text = String.Empty
store2Label.Text = String.Empty
store3Label.Text = String.Empty
companyLabel.Text = String.Empty

For stores As Integer = 1 To 3
For payroll As Integer = 1 To 5
inputPayroll = InputBox("Payroll Amounts" &
payroll.ToString, "Store " &
stores.ToString)
Decimal.TryParse(inputPayroll, payrollAmount)

'add payroll to store total

storeAccumulator += payrollAmount

Next payroll

'add store payroll to company total

companyAccumulator += storeAccumulator

'display store payroll


store1Label.Text =
storeAccumulator.ToString("N2") & ControlChars.NewLine
store2Label.Text =
storeAccumulator.ToString("N2") & ControlChars.NewLine
store3Label.Text =
storeAccumulator.ToString("N2") & ControlChars.NewLine


'reset payroll for next store

storeAccumulator = 0

Next stores

'display company payroll

companyLabel.Text =
companyAccumulator.ToString("C2")


End Sub