Hi, I\'m needing this program for Visual Basic. Instructions follow below: -----
ID: 645590 • Letter: H
Question
Hi, I'm needing this program for Visual Basic. Instructions follow below:
-------------------------------------------------------------------------------
The local Monster shelter has a coding system for creatures. Mr. Shepherd the office manager has some people that never can remember what creatures the codes represent. You state by using parallel single-dimension arrays you will create a listbox that when the employee clicks on an animal type, the coding number will appear in a label. (NOTE: Only single dimension parallel arrays may be used for this exercise - yes I know you could use a two-dimensional array, but not this week). Hint: Listboxes have an event called .SelectedIndex
Animals=Codes
Blood Donors = 100
Shape Shifter= 200
Ghost = 300
Witch = 400
Warlock = 500
Chimaera = 600
Zombie = 700
Japanese (Godzilla, Mothra, Gamera) =800
Vampires=900
Explanation / Answer
Dim animal(9) As String
Dim codes(9) As Integer
Private Sub Form_Load()
c = 100
For i = 1 To 9
codes(i) = c
c = c + 100
Next
End Sub
Private Sub List1_Click()
a = List1.ListIndex
Label2.Caption = codes(a + 1)
End Sub
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.