1

私は先生が頼んだ宿題を終えました。数学は、それがどうあるべきかを計算していません。数学は、ストレスへの対処、時間管理、および監督のスキルに正しく機能しています。ネゴシエーション、面接方法について。乱数を取得しています。インタビューの方法(395) + ダラス(110) = 505 しかし、725 を取得しています。395 + (110x3) を行っていると思います。

Public Class frmMain
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    Dim Workshops As New ArrayList()
    Workshops.Add(New Workshop("Handling Stress", "595"))
    Workshops.Add(New Workshop("Time Management", "695"))
    Workshops.Add(New Workshop("Supervision Skills", "995"))
    Workshops.Add(New Workshop("Negotiation", "1295"))
    Workshops.Add(New Workshop("How to Interview", "395"))
    lbWorkshop.DataSource = Workshops
    lbWorkshop.DisplayMember = "Workshop"
    lbWorkshop.ValueMember = "Price"
    lbWorkshop.ClearSelected()

    Dim Location As New ArrayList()
    Location.Add(New Workshop("Austin", "95"))
    Location.Add(New Workshop("Chicago", "125"))
    Location.Add(New Workshop("Dallas", "110"))
    Location.Add(New Workshop("Orlando", "100"))
    Location.Add(New Workshop("Phoenix", "92"))
    Location.Add(New Workshop("Raleigh", "90"))
    lbLocation.DataSource = Location
    lbLocation.DisplayMember = "Workshop"
    lbLocation.ValueMember = "Price"
    lbLocation.ClearSelected()

End Sub

Private Sub lblAdd_Click(sender As Object, e As EventArgs) Handles lblAdd.Click


    Dim description As String
    Dim value As Integer

    If (lbWorkshop.SelectedIndex > -1) Then
        If (lbLocation.SelectedIndex > -1) Then
            lblStatus1.Text = String.Empty
            If (lbWorkshop.SelectedItem.Equals("How to Interview")) Then
                value = lbWorkshop.SelectedValue + lbLocation.SelectedValue
            ElseIf (lbWorkshop.SelectedItem.Equals("Negotiation")) Then
                value = lbWorkshop.SelectedValue + (lbLocation.SelectedValue * 5)
            Else
                value = lbWorkshop.SelectedValue + (lbLocation.SelectedValue * 3)
            End If
            description = value.ToString

            lbTotal.Items.Add(description)
            lbTotal.ValueMember = value

            Dim total As Integer
            For Each Str As String In lbTotal.Items
                total = total + CInt(Str)
            Next
            lblTotal.Text = FormatCurrency(total.ToString)
        Else
            lblStatus1.Text = "Please Select a Location"
        End If
    Else
        lblStatus1.Text = "Please Select a Workshop"
    End If

End Sub
4

1 に答える 1

1

私が知る限り、それはあなたが求めたことをやっています。これはあなたの意図ですか?

       Else  'Supervision Skills, Negotiation, How to Interview
            value = lbWorkshop.SelectedValue + (lbLocation.SelectedValue * 3)
于 2013-02-12T21:17:30.753 に答える