ANSWERS: 3
  • well show up your code so that we can help you. Post it here.
  • Public Class frmEmployee Dim average, payrate, pay As Decimal Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click 'closes application Me.Close() End Sub Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click 'clear number of pieces Me.tbxPieces.Text = "0" End Sub Private Sub btnClearAll_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClearAll.Click 'Clear summary total Me.tbxPieces.Text = "0" Me.tbxName.Text = "0" Me.tbxPieces.Focus() End Sub Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click 'Calculate the dollar amount Dim pieces, price, workers As Integer Dim payrate, totalpay As Decimal Select Case price Case 1 To 199 price = 0.5 Case 200 To 399 price = 0.55 Case 400 To 599 price = 0.6 Case Is >= 600 price = 0.65 payrate = Decimal.Parse(TextBox1.Text) average = Decimal.Parse(TextBox2.Text) totalpay = (pieces * price) average = (totalpay / workers).ToString() average = average.ToString("C") payrate = payrate.ToString("n") pieces = pieces.ToString("c") Me.TextBox2.Text = average.ToString("C") Me.TextBox1.Text = pay.ToString("N") End Select End Sub Private Sub btnSummaryClick_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) 'display the total number of pieces,total pay and average pay per person Dim pieces, workerscountinteger, workers As Integer Dim messagestring As String Dim payrate, totalpay, price, averagedecimal, totaldecimal As Decimal pay = Decimal.Parse(TextBox1.Text) average = Decimal.Parse(TextBox2.Text) pay = (pieces * price) average = (totalpay / workers).ToString() average = average.ToString("C") PayRate = PayRate.ToString("n") pieces = pieces.ToString("c") Me.TextBox2.Text = average.ToString("C") Me.TextBox1.Text = pay.ToString("N") If IsNumeric(TextBox1) Then If IsNumeric(TextBox2) Then Else messagestring = "Pay Rate: " & payrate.ToString("C") MessageBox.Show(messagestring, " Pay Summary", MessageBoxButtons.OK) End If End If If workerscountinteger > 0 Then 'calculate average averagedecimal = totaldecimal / workerscountinteger End If 'clear name Me.tbxPieces.Focus() Me.tbxName.Focus()
  • Can you post that properly formatted?

Copyright 2020, Wired Ivy, LLC

Answerbag | Terms of Service | Privacy Policy