我完成了老师要求的作业。数学并没有计算出它应该是什么。数学在处理压力、时间管理和监督技能方面非常有效。当我进入谈判,以及如何面试。我得到随机数。如何采访(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